summaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms/powermac/setup.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2018-12-05 22:50:18 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2018-12-22 13:29:50 +0300
commit2c8e65b595cf0bf7c1413404dff9b928a64d27cb (patch)
tree88944063653016523cd63a065876c507ab1651c0 /arch/powerpc/platforms/powermac/setup.c
parent0d1223dd9273b2ba3e965a81092a239405a4931c (diff)
downloadlinux-2c8e65b595cf0bf7c1413404dff9b928a64d27cb.tar.xz
powerpc: Use of_node_name_eq for node name comparisons
Convert string compares of DT node names to use of_node_name_eq helper instead. This removes direct access to the node name pointer. A couple of open coded iterating thru the child node names are converted to use for_each_child_of_node() instead. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/powermac/setup.c')
-rw-r--r--arch/powerpc/platforms/powermac/setup.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 2f00e3daafb0..2e8221e20ee8 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -560,15 +560,9 @@ static int __init check_pmac_serial_console(void)
}
pr_debug("stdout is %pOF\n", prom_stdout);
- name = of_get_property(prom_stdout, "name", NULL);
- if (!name) {
- pr_debug(" stdout package has no name !\n");
- goto not_found;
- }
-
- if (strcmp(name, "ch-a") == 0)
+ if (of_node_name_eq(prom_stdout, "ch-a"))
offset = 0;
- else if (strcmp(name, "ch-b") == 0)
+ else if (of_node_name_eq(prom_stdout, "ch-b"))
offset = 1;
else
goto not_found;