aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2007-07-19 04:47:40 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 13:04:42 -0400
commitbd804eba1c8597cbb7cd5a5f9fe886aae16a079a (patch)
tree082f289809f92db6d23a13cd8fbbb82da125fcda /kernel/sys.c
parentd7372cdf6938ccea23ec9fc68970702fed9ec3c8 (diff)
PM: Introduce pm_power_off_prepare
Introduce the pm_power_off_prepare() callback that can be registered by the interested platforms in analogy with pm_idle() and pm_power_off(), used for preparing the system to power off (needed by ACPI). This allows us to drop acpi_sysclass and device_acpi that are only defined in order to register the ACPI power off preparation callback, which is needed by pm_power_off() registered in a much different way. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 18987c7f6add..d40e40a9446c 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -100,6 +100,13 @@ struct pid *cad_pid;
100EXPORT_SYMBOL(cad_pid); 100EXPORT_SYMBOL(cad_pid);
101 101
102/* 102/*
103 * If set, this is used for preparing the system to power off.
104 */
105
106void (*pm_power_off_prepare)(void);
107EXPORT_SYMBOL(pm_power_off_prepare);
108
109/*
103 * Notifier list for kernel code which wants to be called 110 * Notifier list for kernel code which wants to be called
104 * at shutdown. This is used to stop any idling DMA operations 111 * at shutdown. This is used to stop any idling DMA operations
105 * and the like. 112 * and the like.
@@ -867,6 +874,8 @@ EXPORT_SYMBOL_GPL(kernel_halt);
867void kernel_power_off(void) 874void kernel_power_off(void)
868{ 875{
869 kernel_shutdown_prepare(SYSTEM_POWER_OFF); 876 kernel_shutdown_prepare(SYSTEM_POWER_OFF);
877 if (pm_power_off_prepare)
878 pm_power_off_prepare();
870 printk(KERN_EMERG "Power down.\n"); 879 printk(KERN_EMERG "Power down.\n");
871 machine_power_off(); 880 machine_power_off();
872} 881}