linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Make function of pm_power_off consistent with x86
@ 2006-09-06 14:02 Corey Minyard
  0 siblings, 0 replies; only message in thread
From: Corey Minyard @ 2006-09-06 14:02 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: jbarnett


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>

Index: linux-2.6.17/arch/ppc/kernel/setup.c
===================================================================
--- linux-2.6.17.orig/arch/ppc/kernel/setup.c
+++ linux-2.6.17/arch/ppc/kernel/setup.c
@@ -128,11 +128,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();
 }
 
@@ -144,7 +141,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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-06 14:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-06 14:02 [PATCH] Make function of pm_power_off consistent with x86 Corey Minyard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).