diff options
Diffstat (limited to 'drivers/base/power/shutdown.c')
-rw-r--r-- | drivers/base/power/shutdown.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/drivers/base/power/shutdown.c b/drivers/base/power/shutdown.c index d1e023fbe169..f50a08be424b 100644 --- a/drivers/base/power/shutdown.c +++ b/drivers/base/power/shutdown.c | |||
@@ -19,20 +19,6 @@ | |||
19 | extern struct subsystem devices_subsys; | 19 | extern struct subsystem devices_subsys; |
20 | 20 | ||
21 | 21 | ||
22 | int device_detach_shutdown(struct device * dev) | ||
23 | { | ||
24 | if (!dev->detach_state) | ||
25 | return 0; | ||
26 | |||
27 | if (dev->detach_state == DEVICE_PM_OFF) { | ||
28 | if (dev->driver && dev->driver->shutdown) | ||
29 | dev->driver->shutdown(dev); | ||
30 | return 0; | ||
31 | } | ||
32 | return dpm_runtime_suspend(dev, dev->detach_state); | ||
33 | } | ||
34 | |||
35 | |||
36 | /** | 22 | /** |
37 | * We handle system devices differently - we suspend and shut them | 23 | * We handle system devices differently - we suspend and shut them |
38 | * down last and resume them first. That way, we don't do anything stupid like | 24 | * down last and resume them first. That way, we don't do anything stupid like |
@@ -52,13 +38,12 @@ void device_shutdown(void) | |||
52 | struct device * dev; | 38 | struct device * dev; |
53 | 39 | ||
54 | down_write(&devices_subsys.rwsem); | 40 | down_write(&devices_subsys.rwsem); |
55 | list_for_each_entry_reverse(dev, &devices_subsys.kset.list, kobj.entry) { | 41 | list_for_each_entry_reverse(dev, &devices_subsys.kset.list, |
56 | pr_debug("shutting down %s: ", dev->bus_id); | 42 | kobj.entry) { |
57 | if (dev->driver && dev->driver->shutdown) { | 43 | if (dev->driver && dev->driver->shutdown) { |
58 | pr_debug("Ok\n"); | 44 | dev_dbg(dev, "shutdown\n"); |
59 | dev->driver->shutdown(dev); | 45 | dev->driver->shutdown(dev); |
60 | } else | 46 | } |
61 | pr_debug("Ignored.\n"); | ||
62 | } | 47 | } |
63 | up_write(&devices_subsys.rwsem); | 48 | up_write(&devices_subsys.rwsem); |
64 | 49 | ||