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>
This commit is contained in:
committed by
David S. Miller
parent
29c990dfc7
commit
88ca0557a0
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user