diff options
author | Qinglang Miao <[email protected]> | 2020-07-28 10:28:07 +0800 |
---|---|---|
committer | Michael Ellerman <[email protected]> | 2020-07-29 22:30:33 +1000 |
commit | b6ac59d39a348af29477d7bfdc3ba23526e3f4ea (patch) | |
tree | 088301b262c96312e397012ffdd6cddbebe2055a /arch/powerpc/platforms/powermac/low_i2c.c | |
parent | f2af201002a8bc22500c04cc474ea480bf361351 (diff) |
powerpc: use for_each_child_of_node() macro
Use for_each_child_of_node() macro instead of open coding it.
Signed-off-by: Qinglang Miao <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'arch/powerpc/platforms/powermac/low_i2c.c')
-rw-r--r-- | arch/powerpc/platforms/powermac/low_i2c.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c index bf4be4b53b44..f77a59b5c2e1 100644 --- a/arch/powerpc/platforms/powermac/low_i2c.c +++ b/arch/powerpc/platforms/powermac/low_i2c.c @@ -629,8 +629,7 @@ static void __init kw_i2c_probe(void) for (i = 0; i < chans; i++) kw_i2c_add(host, np, np, i); } else { - for (child = NULL; - (child = of_get_next_child(np, child)) != NULL;) { + for_each_child_of_node(np, child) { const u32 *reg = of_get_property(child, "reg", NULL); if (reg == NULL) @@ -1193,8 +1192,7 @@ static void pmac_i2c_devscan(void (*callback)(struct device_node *dev, * platform function instance */ list_for_each_entry(bus, &pmac_i2c_busses, link) { - for (np = NULL; - (np = of_get_next_child(bus->busnode, np)) != NULL;) { + for_each_child_of_node(bus->busnode, np) { struct whitelist_ent *p; /* If multibus, check if device is on that bus */ if (bus->flags & pmac_i2c_multibus) |