diff options
author | Rob Herring <robh@kernel.org> | 2018-11-16 15:06:59 -0600 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-18 13:35:21 -0800 |
commit | 88ca0557a01386834cbb59d5fc43041e810cbc69 (patch) | |
tree | 52b03e8f6b668ed89277548d2c0f895e4c5d82ed /arch/sparc/kernel/reboot.c | |
parent | 29c990dfc77c58b21a0f2ff4640b6a26955d0661 (diff) | |
download | linux-stable-88ca0557a01386834cbb59d5fc43041e810cbc69.tar.gz linux-stable-88ca0557a01386834cbb59d5fc43041e810cbc69.tar.bz2 linux-stable-88ca0557a01386834cbb59d5fc43041e810cbc69.zip |
sparc: 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.
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/reboot.c')
-rw-r--r-- | arch/sparc/kernel/reboot.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/sparc/kernel/reboot.c b/arch/sparc/kernel/reboot.c index 7933ee365207..69c1b6c047d5 100644 --- a/arch/sparc/kernel/reboot.c +++ b/arch/sparc/kernel/reboot.c @@ -7,6 +7,7 @@ #include <linux/reboot.h> #include <linux/export.h> #include <linux/pm.h> +#include <linux/of.h> #include <asm/oplib.h> #include <asm/prom.h> @@ -25,7 +26,7 @@ EXPORT_SYMBOL(pm_power_off); void machine_power_off(void) { - if (strcmp(of_console_device->type, "serial") || scons_pwroff) + if (!of_node_is_type(of_console_device, "serial") || scons_pwroff) prom_halt_power_off(); prom_halt(); |