[RFC] poweroff via pm_power_off if set
Christian Krafft
krafft at de.ibm.com
Sat Jun 14 01:36:49 EST 2008
This patch is needed to make ipmi_poweroff working on powerpc.
It straightens the poweroff procedure to match with other architectures.
At the moment powerpc plattforms can define their poweroff method using
ppc_md.power_off. The only way for plattform independent driver (ipmi_poweroff)
to register it's poweroff function is to use pm_power_off. So machine_power_off
should check whether pm_power_off has been set and if so it should be used.
If not, plattform dependent ppc_md.power_off should be called.
Signed-off-by: Christian Krafft <krafft at de.ibm.com>
Index: linux.git/arch/powerpc/kernel/setup-common.c
===================================================================
--- linux.git.orig/arch/powerpc/kernel/setup-common.c
+++ linux.git/arch/powerpc/kernel/setup-common.c
@@ -121,6 +121,8 @@ void machine_restart(char *cmd)
void machine_power_off(void)
{
machine_shutdown();
+ if (pm_power_off)
+ pm_power_off();
if (ppc_md.power_off)
ppc_md.power_off();
#ifdef CONFIG_SMP
@@ -133,7 +135,7 @@ void machine_power_off(void)
/* Used by the G5 thermal driver */
EXPORT_SYMBOL_GPL(machine_power_off);
-void (*pm_power_off)(void) = machine_power_off;
+void (*pm_power_off)(void) = NULL;
EXPORT_SYMBOL_GPL(pm_power_off);
void machine_halt(void)
--
Mit freundlichen Gruessen,
kind regards,
Christian Krafft
IBM Systems & Technology Group,
Linux Kernel Development
IT Specialist
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Herbert Kircher
Sitz der Gesellschaft: Boeblingen
Registriergericht: Amtsgericht Stuttgart, HRB 243294
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20080613/13a868b1/attachment.pgp>
More information about the Linuxppc-dev
mailing list