aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-02-01 22:06:15 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-01 22:06:15 -0800
commit59ed2f59e4ea6a32f9591e378da7935f713a7000 (patch)
treea1276a611dbb1bc44685ef8af363e99603e60047 /kernel
parent9ad11ab48b1ad618bf47076e9e579f267f5306c2 (diff)
parentb8e4d89357fc434618a59c1047cac72641191805 (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/disk.c9
-rw-r--r--kernel/power/main.c4
-rw-r--r--kernel/sys.c25
3 files changed, 13 insertions, 25 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index f2b3b0ea512..0b43847dc98 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -53,7 +53,7 @@ static void power_down(suspend_disk_method_t mode)
switch(mode) {
case PM_DISK_PLATFORM:
- kernel_power_off_prepare();
+ kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK);
error = pm_ops->enter(PM_SUSPEND_DISK);
break;
case PM_DISK_SHUTDOWN:
@@ -95,13 +95,6 @@ static int prepare_processes(void)
goto thaw;
}
- if (pm_disk_mode == PM_DISK_PLATFORM) {
- if (pm_ops && pm_ops->prepare) {
- if ((error = pm_ops->prepare(PM_SUSPEND_DISK)))
- goto thaw;
- }
- }
-
/* Free memory before shutting down devices. */
if (!(error = swsusp_shrink_memory()))
return 0;
diff --git a/kernel/power/main.c b/kernel/power/main.c
index d253f3ae2fa..9cb235cba4a 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -133,10 +133,10 @@ static int suspend_enter(suspend_state_t state)
static void suspend_finish(suspend_state_t state)
{
device_resume();
- if (pm_ops && pm_ops->finish)
- pm_ops->finish(state);
thaw_processes();
enable_nonboot_cpus();
+ if (pm_ops && pm_ops->finish)
+ pm_ops->finish(state);
pm_restore_console();
}
diff --git a/kernel/sys.c b/kernel/sys.c
index d09cac23fdf..0929c698aff 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -440,23 +440,25 @@ void kernel_kexec(void)
}
EXPORT_SYMBOL_GPL(kernel_kexec);
+void kernel_shutdown_prepare(enum system_states state)
+{
+ notifier_call_chain(&reboot_notifier_list,
+ (state == SYSTEM_HALT)?SYS_HALT:SYS_POWER_OFF, NULL);
+ system_state = state;
+ device_shutdown();
+}
/**
* kernel_halt - halt the system
*
* Shutdown everything and perform a clean system halt.
*/
-void kernel_halt_prepare(void)
-{
- notifier_call_chain(&reboot_notifier_list, SYS_HALT, NULL);
- system_state = SYSTEM_HALT;
- device_shutdown();
-}
void kernel_halt(void)
{
- kernel_halt_prepare();
+ kernel_shutdown_prepare(SYSTEM_HALT);
printk(KERN_EMERG "System halted.\n");
machine_halt();
}
+
EXPORT_SYMBOL_GPL(kernel_halt);
/**
@@ -464,20 +466,13 @@ EXPORT_SYMBOL_GPL(kernel_halt);
*
* Shutdown everything and perform a clean system power_off.
*/
-void kernel_power_off_prepare(void)
-{
- notifier_call_chain(&reboot_notifier_list, SYS_POWER_OFF, NULL);
- system_state = SYSTEM_POWER_OFF;
- device_shutdown();
-}
void kernel_power_off(void)
{
- kernel_power_off_prepare();
+ kernel_shutdown_prepare(SYSTEM_POWER_OFF);
printk(KERN_EMERG "Power down.\n");
machine_power_off();
}
EXPORT_SYMBOL_GPL(kernel_power_off);
-
/*
* Reboot system call: for obvious reasons only root may call it,
* and even root needs to set up some magic numbers in the registers