diff options
author | Rob Herring <robh@kernel.org> | 2018-11-16 23:11:00 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-11-26 12:33:37 +0100 |
commit | e5480bdcc4429e4c172d450ee1db1934d84482ef (patch) | |
tree | 2a788e3bd8b41b1d89a6ed7487e08ec84c2e2bc4 /arch/powerpc/platforms/chrp | |
parent | powerpc: Rework btext_find_display to use of_stdout and device_type helpers (diff) | |
download | linux-e5480bdcc4429e4c172d450ee1db1934d84482ef.tar.xz linux-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/chrp')
-rw-r--r-- | arch/powerpc/platforms/chrp/pci.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/chrp/setup.c | 5 |
2 files changed, 3 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c index 5ddb57b82921..b020c757d2bf 100644 --- a/arch/powerpc/platforms/chrp/pci.c +++ b/arch/powerpc/platforms/chrp/pci.c @@ -230,8 +230,8 @@ chrp_find_bridges(void) else if (strncmp(machine, "Pegasos", 7) == 0) is_pegasos = 1; } - for (dev = root->child; dev != NULL; dev = dev->sibling) { - if (dev->type == NULL || strcmp(dev->type, "pci") != 0) + for_each_child_of_node(root, dev) { + if (!of_node_is_type(dev, "pci")) continue; ++index; /* The GG2 bridge on the LongTrail doesn't have an address */ diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c index d6d8ffc0271e..3c21f046e20c 100644 --- a/arch/powerpc/platforms/chrp/setup.c +++ b/arch/powerpc/platforms/chrp/setup.c @@ -280,10 +280,7 @@ static __init void chrp_init(void) node = of_find_node_by_path(property); if (!node) return; - property = of_get_property(node, "device_type", NULL); - if (!property) - goto out_put; - if (strcmp(property, "serial")) + if (!of_node_is_type(node, "serial")) goto out_put; /* * The 9pin connector is either /failsafe |