aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powermac/low_i2c.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2018-11-16 16:11:00 -0600
committerMichael Ellerman <mpe@ellerman.id.au>2018-11-26 22:33:37 +1100
commite5480bdcc4429e4c172d450ee1db1934d84482ef (patch)
tree2a788e3bd8b41b1d89a6ed7487e08ec84c2e2bc4 /arch/powerpc/platforms/powermac/low_i2c.c
parentpowerpc: Rework btext_find_display to use of_stdout and device_type helpers (diff)
downloadlinux-dev-e5480bdcc4429e4c172d450ee1db1934d84482ef.tar.xz
linux-dev-e5480bdcc4429e4c172d450ee1db1934d84482ef.zip
powerpc: Use device_type helpers to access the node type
Remove directly accessing device_node.type pointer and use the accessors instead. This will eventually allow removing the type pointer. Replace the open coded iterating over child nodes with for_each_child_of_node() while we're here. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/powermac/low_i2c.c')
-rw-r--r--arch/powerpc/platforms/powermac/low_i2c.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index d4d411820597..84bace3b546a 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -917,10 +917,9 @@ static void __init smu_i2c_probe(void)
* type as older device trees mix i2c busses and other things
* at the same level
*/
- for (busnode = NULL;
- (busnode = of_get_next_child(controller, busnode)) != NULL;) {
- if (strcmp(busnode->type, "i2c") &&
- strcmp(busnode->type, "i2c-bus"))
+ for_each_child_of_node(controller, busnode) {
+ if (!of_node_is_type(busnode, "i2c") &&
+ !of_node_is_type(busnode, "i2c-bus"))
continue;
reg = of_get_property(busnode, "reg", NULL);
if (reg == NULL)