From: Corey Minyard Date: Wed, 6 Sep 2006 14:02:53 +0000 (-0500) Subject: [POWERPC] Make function of pm_power_off consistent with x86 X-Git-Tag: v2.6.19-rc1~1300^2~40 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=477bcae4c289a60f2303fbd4a3a875dcca647cf8;p=linux-2.6 [POWERPC] Make function of pm_power_off consistent with x86 Allow the pm_power_off function variable in PPC to work as an override. This makes the function consistent with the other architectures and it allows generic poweroff operations (like those provided in IPMI systems) to work properly on PPC. Signed-off-by: Corey Minyard Cc: Joseph Barnett Signed-off-by: Paul Mackerras --- diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c index a74f46d982..5458ac5da7 100644 --- a/arch/ppc/kernel/setup.c +++ b/arch/ppc/kernel/setup.c @@ -127,11 +127,8 @@ void machine_restart(char *cmd) ppc_md.restart(cmd); } -void machine_power_off(void) +static void ppc_generic_power_off(void) { -#ifdef CONFIG_NVRAM - nvram_sync(); -#endif ppc_md.power_off(); } @@ -143,7 +140,17 @@ void machine_halt(void) ppc_md.halt(); } -void (*pm_power_off)(void) = machine_power_off; +void (*pm_power_off)(void) = ppc_generic_power_off; + +void machine_power_off(void) +{ +#ifdef CONFIG_NVRAM + nvram_sync(); +#endif + if (pm_power_off) + pm_power_off(); + ppc_generic_power_off(); +} #ifdef CONFIG_TAU extern u32 cpu_temp(unsigned long cpu);