瀏覽代碼

[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 <minyard@acm.org>
Cc: Joseph Barnett <jbarnett@motorola.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Corey Minyard 18 年之前
父節點
當前提交
477bcae4c2
共有 1 個文件被更改,包括 12 次插入5 次删除
  1. 12 5
      arch/ppc/kernel/setup.c

+ 12 - 5
arch/ppc/kernel/setup.c

@@ -127,11 +127,8 @@ void machine_restart(char *cmd)
 	ppc_md.restart(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();
 	ppc_md.power_off();
 }
 }
 
 
@@ -143,7 +140,17 @@ void machine_halt(void)
 	ppc_md.halt();
 	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
 #ifdef CONFIG_TAU
 extern u32 cpu_temp(unsigned long cpu);
 extern u32 cpu_temp(unsigned long cpu);