aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/base/power/shutdown.c2
-rw-r--r--include/linux/device.h3
-rw-r--r--kernel/power/disk.c1
-rw-r--r--kernel/sys.c3
4 files changed, 7 insertions, 2 deletions
diff --git a/drivers/base/power/shutdown.c b/drivers/base/power/shutdown.c
index a47ee1b70d2..56e8eaaac01 100644
--- a/drivers/base/power/shutdown.c
+++ b/drivers/base/power/shutdown.c
@@ -44,7 +44,5 @@ void device_shutdown(void)
dev->driver->shutdown(dev);
}
}
-
- sysdev_shutdown();
}
diff --git a/include/linux/device.h b/include/linux/device.h
index d9f0a57f5a2..3a38d1f70cb 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -551,6 +551,9 @@ extern void put_device(struct device * dev);
/* drivers/base/power/shutdown.c */
extern void device_shutdown(void);
+/* drivers/base/sys.c */
+extern void sysdev_shutdown(void);
+
/* drivers/base/firmware.c */
extern int __must_check firmware_register(struct kset *);
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index 324ac0188ce..eb72255b5c8 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -216,6 +216,7 @@ int hibernation_platform_enter(void)
* sleep state after all
*/
error = hibernation_ops->prepare();
+ sysdev_shutdown();
if (!error)
error = hibernation_ops->enter();
} else {
diff --git a/kernel/sys.c b/kernel/sys.c
index 08562f41976..14f8adcfffd 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -804,6 +804,7 @@ static void kernel_restart_prepare(char *cmd)
blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd);
system_state = SYSTEM_RESTART;
device_shutdown();
+ sysdev_shutdown();
}
/**
@@ -860,6 +861,7 @@ void kernel_shutdown_prepare(enum system_states state)
void kernel_halt(void)
{
kernel_shutdown_prepare(SYSTEM_HALT);
+ sysdev_shutdown();
printk(KERN_EMERG "System halted.\n");
machine_halt();
}
@@ -876,6 +878,7 @@ void kernel_power_off(void)
kernel_shutdown_prepare(SYSTEM_POWER_OFF);
if (pm_power_off_prepare)
pm_power_off_prepare();
+ sysdev_shutdown();
printk(KERN_EMERG "Power down.\n");
machine_power_off();
}