diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-02-06 13:43:13 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-02-06 13:43:13 +0100 |
commit | b2faf597d93bdf5e2d12d93ea0815935a73f749e (patch) | |
tree | 1876616290ff282b8a0814e2429d23e0104f3701 /kernel/sys.c | |
parent | Merge branch 'origin' (diff) | |
parent | [PATCH] USB: Fix GPL markings on usb core functions. (diff) | |
download | linux-b2faf597d93bdf5e2d12d93ea0815935a73f749e.tar.xz linux-b2faf597d93bdf5e2d12d93ea0815935a73f749e.zip |
Merge branch 'origin'
Diffstat (limited to 'kernel/sys.c')
-rw-r--r-- | kernel/sys.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index d09cac23fdfd..0929c698affc 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 |