aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/power/shutdown.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/power/shutdown.c')
-rw-r--r--drivers/base/power/shutdown.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/base/power/shutdown.c b/drivers/base/power/shutdown.c
index d1e023fbe169..97979901c149 100644
--- a/drivers/base/power/shutdown.c
+++ b/drivers/base/power/shutdown.c
@@ -25,8 +25,10 @@ int device_detach_shutdown(struct device * dev)
25 return 0; 25 return 0;
26 26
27 if (dev->detach_state == DEVICE_PM_OFF) { 27 if (dev->detach_state == DEVICE_PM_OFF) {
28 if (dev->driver && dev->driver->shutdown) 28 if (dev->driver && dev->driver->shutdown) {
29 dev_dbg(dev, "shutdown\n");
29 dev->driver->shutdown(dev); 30 dev->driver->shutdown(dev);
31 }
30 return 0; 32 return 0;
31 } 33 }
32 return dpm_runtime_suspend(dev, dev->detach_state); 34 return dpm_runtime_suspend(dev, dev->detach_state);
@@ -52,13 +54,12 @@ void device_shutdown(void)
52 struct device * dev; 54 struct device * dev;
53 55
54 down_write(&devices_subsys.rwsem); 56 down_write(&devices_subsys.rwsem);
55 list_for_each_entry_reverse(dev, &devices_subsys.kset.list, kobj.entry) { 57 list_for_each_entry_reverse(dev, &devices_subsys.kset.list,
56 pr_debug("shutting down %s: ", dev->bus_id); 58 kobj.entry) {
57 if (dev->driver && dev->driver->shutdown) { 59 if (dev->driver && dev->driver->shutdown) {
58 pr_debug("Ok\n"); 60 dev_dbg(dev, "shutdown\n");
59 dev->driver->shutdown(dev); 61 dev->driver->shutdown(dev);
60 } else 62 }
61 pr_debug("Ignored.\n");
62 } 63 }
63 up_write(&devices_subsys.rwsem); 64 up_write(&devices_subsys.rwsem);
64 65