[PATCH] powerpc: Allow for ppc_md restart, power_off, and halt to be NULL

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>

authored by

Kumar Gala and committed by
Paul Mackerras
b8e383d5 7a45fb19

+6 -3
+6 -3
arch/powerpc/kernel/setup-common.c
··· 100 void machine_restart(char *cmd) 101 { 102 machine_shutdown(); 103 - ppc_md.restart(cmd); 104 #ifdef CONFIG_SMP 105 smp_send_stop(); 106 #endif ··· 113 void machine_power_off(void) 114 { 115 machine_shutdown(); 116 - ppc_md.power_off(); 117 #ifdef CONFIG_SMP 118 smp_send_stop(); 119 #endif ··· 131 void machine_halt(void) 132 { 133 machine_shutdown(); 134 - ppc_md.halt(); 135 #ifdef CONFIG_SMP 136 smp_send_stop(); 137 #endif
··· 100 void machine_restart(char *cmd) 101 { 102 machine_shutdown(); 103 + if (ppc_md.restart) 104 + ppc_md.restart(cmd); 105 #ifdef CONFIG_SMP 106 smp_send_stop(); 107 #endif ··· 112 void machine_power_off(void) 113 { 114 machine_shutdown(); 115 + if (ppc_md.power_off) 116 + ppc_md.power_off(); 117 #ifdef CONFIG_SMP 118 smp_send_stop(); 119 #endif ··· 129 void machine_halt(void) 130 { 131 machine_shutdown(); 132 + if (ppc_md.halt) 133 + ppc_md.halt(); 134 #ifdef CONFIG_SMP 135 smp_send_stop(); 136 #endif