Commit d0d738a4 authored by Andrey Smirnov's avatar Andrey Smirnov Committed by Scott Wood

powerpc: Factor out common code in setup-common.c

Factor out a small bit of common code in machine_restart(),
machine_power_off() and machine_halt().
Signed-off-by: default avatarAndrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: default avatarScott Wood <oss@buserror.net>
parent 625f3eea
...@@ -131,15 +131,22 @@ void machine_shutdown(void) ...@@ -131,15 +131,22 @@ void machine_shutdown(void)
ppc_md.machine_shutdown(); ppc_md.machine_shutdown();
} }
static void machine_hang(void)
{
pr_emerg("System Halted, OK to turn off power\n");
local_irq_disable();
while (1)
;
}
void machine_restart(char *cmd) void machine_restart(char *cmd)
{ {
machine_shutdown(); machine_shutdown();
if (ppc_md.restart) if (ppc_md.restart)
ppc_md.restart(cmd); ppc_md.restart(cmd);
smp_send_stop(); smp_send_stop();
printk(KERN_EMERG "System Halted, OK to turn off power\n"); machine_hang();
local_irq_disable();
while (1) ;
} }
void machine_power_off(void) void machine_power_off(void)
...@@ -147,10 +154,9 @@ void machine_power_off(void) ...@@ -147,10 +154,9 @@ void machine_power_off(void)
machine_shutdown(); machine_shutdown();
if (pm_power_off) if (pm_power_off)
pm_power_off(); pm_power_off();
smp_send_stop(); smp_send_stop();
printk(KERN_EMERG "System Halted, OK to turn off power\n"); machine_hang();
local_irq_disable();
while (1) ;
} }
/* Used by the G5 thermal driver */ /* Used by the G5 thermal driver */
EXPORT_SYMBOL_GPL(machine_power_off); EXPORT_SYMBOL_GPL(machine_power_off);
...@@ -163,10 +169,9 @@ void machine_halt(void) ...@@ -163,10 +169,9 @@ void machine_halt(void)
machine_shutdown(); machine_shutdown();
if (ppc_md.halt) if (ppc_md.halt)
ppc_md.halt(); ppc_md.halt();
smp_send_stop(); smp_send_stop();
printk(KERN_EMERG "System Halted, OK to turn off power\n"); machine_hang();
local_irq_disable();
while (1) ;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment