diff options
Diffstat (limited to 'drivers/base/power')
-rw-r--r-- | drivers/base/power/runtime.c | 3 | ||||
-rw-r--r-- | drivers/base/power/shutdown.c | 9 |
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index adbc3148c03..96370ec1d67 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -62,8 +62,10 @@ int dpm_runtime_suspend(struct device * dev, pm_message_t state) up(&dpm_sem); return error; } +EXPORT_SYMBOL(dpm_runtime_suspend); +#if 0 /** * dpm_set_power_state - Update power_state field. * @dev: Device. @@ -80,3 +82,4 @@ void dpm_set_power_state(struct device * dev, pm_message_t state) dev->power.power_state = state; up(&dpm_sem); } +#endif /* 0 */ diff --git a/drivers/base/power/shutdown.c b/drivers/base/power/shutdown.c index f50a08be424..c2475f3134e 100644 --- a/drivers/base/power/shutdown.c +++ b/drivers/base/power/shutdown.c @@ -35,12 +35,15 @@ extern int sysdev_shutdown(void); */ void device_shutdown(void) { - struct device * dev; + struct device * dev, *devn; down_write(&devices_subsys.rwsem); - list_for_each_entry_reverse(dev, &devices_subsys.kset.list, + list_for_each_entry_safe_reverse(dev, devn, &devices_subsys.kset.list, kobj.entry) { - if (dev->driver && dev->driver->shutdown) { + if (dev->bus && dev->bus->shutdown) { + dev_dbg(dev, "shutdown\n"); + dev->bus->shutdown(dev); + } else if (dev->driver && dev->driver->shutdown) { dev_dbg(dev, "shutdown\n"); dev->driver->shutdown(dev); } |