aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/maple/pci.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/maple/pci.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/maple/pci.c')
-rw-r--r--arch/powerpc/platforms/maple/pci.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c
index e3821379e86f..13fba004b7e7 100644
--- a/arch/powerpc/platforms/maple/pci.c
+++ b/arch/powerpc/platforms/maple/pci.c
@@ -604,10 +604,8 @@ void __init maple_pci_init(void)
printk(KERN_CRIT "maple_find_bridges: can't find root of device tree\n");
return;
}
- for (np = NULL; (np = of_get_next_child(root, np)) != NULL;) {
- if (!np->type)
- continue;
- if (strcmp(np->type, "pci") && strcmp(np->type, "ht"))
+ for_each_child_of_node(root, np) {
+ if (!of_node_is_type(np, "pci") && !of_node_is_type(np, "ht"))
continue;
if ((of_device_is_compatible(np, "u4-pcie") ||
of_device_is_compatible(np, "u3-agp")) &&