[PATCH] powerpc: Allow for ppc_md restart, power_off, and halt to be NULL
authorKumar Gala <galak@gate.crashing.org>
Fri, 13 Jan 2006 16:15:17 +0000 (10:15 -0600)
committerPaul Mackerras <paulus@samba.org>
Sat, 14 Jan 2006 00:12:23 +0000 (11:12 +1100)
On a number of embedded reference boards there isn't always a
way to reset, power_off, or halt the board.  Rather than having
each board implement a spin loop just let the generic code do
it.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/setup-common.c

index d5c52fae023a1b996f71f5e38a1ed0d5964c9d3e..be12041c0fc5404ab8b811050f45de883c225631 100644 (file)
@@ -100,7 +100,8 @@ void machine_shutdown(void)
 void machine_restart(char *cmd)
 {
        machine_shutdown();
-       ppc_md.restart(cmd);
+       if (ppc_md.restart)
+               ppc_md.restart(cmd);
 #ifdef CONFIG_SMP
        smp_send_stop();
 #endif
@@ -112,7 +113,8 @@ void machine_restart(char *cmd)
 void machine_power_off(void)
 {
        machine_shutdown();
-       ppc_md.power_off();
+       if (ppc_md.power_off)
+               ppc_md.power_off();
 #ifdef CONFIG_SMP
        smp_send_stop();
 #endif
@@ -129,7 +131,8 @@ EXPORT_SYMBOL_GPL(pm_power_off);
 void machine_halt(void)
 {
        machine_shutdown();
-       ppc_md.halt();
+       if (ppc_md.halt)
+               ppc_md.halt();
 #ifdef CONFIG_SMP
        smp_send_stop();
 #endif