summaryrefslogtreecommitdiffstats
path: root/drivers/base/core.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-11-26 22:11:55 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 20:40:25 -0800
commit37b0c020343080241984d978981d6caf877b278a (patch)
tree6a602f153ac0713cdecd4f8b355844387fba90bf /drivers/base/core.c
parent822a89ed1ea0f7a2d8079307426fbeeac0370138 (diff)
downloadlinux-37b0c020343080241984d978981d6caf877b278a.tar.bz2
driver core: clean up device_shutdown
device_shutdown does not need to be in a separate file. Move it into the driver core file where it belongs. This also moves us one more step closer to making devices_kset static, now only the crazy sysdevs are keeping that from happening... Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/core.c')
-rw-r--r--drivers/base/core.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index d2de2d59af42..b3a931fe6b16 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1415,5 +1415,23 @@ out:
put_device(dev);
return error;
}
-
EXPORT_SYMBOL_GPL(device_move);
+
+/**
+ * device_shutdown - call ->shutdown() on each device to shutdown.
+ */
+void device_shutdown(void)
+{
+ struct device * dev, *devn;
+
+ list_for_each_entry_safe_reverse(dev, devn, &devices_kset->list,
+ kobj.entry) {
+ 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);
+ }
+ }
+}