driver core: clean up device_shutdown
authorGreg Kroah-Hartman <gregkh@suse.de>
Tue, 27 Nov 2007 06:11:55 +0000 (22:11 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 25 Jan 2008 04:40:25 +0000 (20:40 -0800)
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>
drivers/base/core.c
drivers/base/power/Makefile
drivers/base/power/shutdown.c [deleted file]

index d2de2d59af4285ea7288edaf018f8defa341a045..b3a931fe6b165d7d8b5d22b8e627001d0d95f8f9 100644 (file)
@@ -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);
+               }
+       }
+}
index 44504e6618fbb0006e369cf39ff75d55578057bb..06a86fe6a78d77a1c2d0a3b7e84003456c430933 100644 (file)
@@ -1,4 +1,3 @@
-obj-y                  := shutdown.o
 obj-$(CONFIG_PM)       += sysfs.o
 obj-$(CONFIG_PM_SLEEP) += main.o
 obj-$(CONFIG_PM_TRACE) += trace.o
diff --git a/drivers/base/power/shutdown.c b/drivers/base/power/shutdown.c
deleted file mode 100644 (file)
index 5b6bc16..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * shutdown.c - power management functions for the device tree.
- *
- * Copyright (c) 2002-3 Patrick Mochel
- *              2002-3 Open Source Development Lab
- *
- * This file is released under the GPLv2
- *
- */
-
-#include <linux/device.h>
-#include <asm/semaphore.h>
-
-#include "../base.h"
-
-/**
- * We handle system devices differently - we suspend and shut them
- * down last and resume them first. That way, we don't do anything stupid like
- * shutting down the interrupt controller before any devices..
- *
- * Note that there are not different stages for power management calls -
- * they only get one called once when interrupts are disabled.
- */
-
-
-/**
- * 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);
-               }
-       }
-}