diff options
| author | Patrick Mochel <mochel@segfault.osdl.org> | 2002-04-04 17:22:45 -0800 |
|---|---|---|
| committer | Patrick Mochel <mochel@hera.kernel.org> | 2002-04-04 17:22:45 -0800 |
| commit | 268a3cf58d1c438df63da452c64fd47a77ba65b3 (patch) | |
| tree | fab71b10700797456619720ca8c00bbe3f487fc2 /kernel/sys.c | |
| parent | 456f5a1cc305573814d1ece2003b2631e0139077 (diff) | |
Add device_shutdown() calls to reboot and power off transitions (and let the user know)
Diffstat (limited to 'kernel/sys.c')
| -rw-r--r-- | kernel/sys.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index 54f018e69bf5..1642e115d2b0 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -15,6 +15,7 @@ #include <linux/init.h> #include <linux/highuid.h> #include <linux/fs.h> +#include <linux/device.h> #include <asm/uaccess.h> #include <asm/io.h> @@ -298,6 +299,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void * arg) switch (cmd) { case LINUX_REBOOT_CMD_RESTART: notifier_call_chain(&reboot_notifier_list, SYS_RESTART, NULL); + device_shutdown(); printk(KERN_EMERG "Restarting system.\n"); machine_restart(NULL); break; @@ -312,6 +314,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void * arg) case LINUX_REBOOT_CMD_HALT: notifier_call_chain(&reboot_notifier_list, SYS_HALT, NULL); + device_shutdown(); printk(KERN_EMERG "System halted.\n"); machine_halt(); do_exit(0); @@ -319,6 +322,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void * arg) case LINUX_REBOOT_CMD_POWER_OFF: notifier_call_chain(&reboot_notifier_list, SYS_POWER_OFF, NULL); + device_shutdown(); printk(KERN_EMERG "Power down.\n"); machine_power_off(); do_exit(0); @@ -332,6 +336,7 @@ asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, void * arg) buffer[sizeof(buffer) - 1] = '\0'; notifier_call_chain(&reboot_notifier_list, SYS_RESTART, buffer); + device_shutdown(); printk(KERN_EMERG "Restarting system with command '%s'.\n", buffer); machine_restart(buffer); break; |
