Skip to content

Commit

Permalink
driver core: clean up device_shutdown
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Greg Kroah-Hartman committed Jan 25, 2008
1 parent 822a89e commit 37b0c02
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 45 deletions.
20 changes: 19 additions & 1 deletion drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1415,5 +1415,23 @@ int device_move(struct device *dev, struct device *new_parent)
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);
}
}
}
1 change: 0 additions & 1 deletion drivers/base/power/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
43 changes: 0 additions & 43 deletions drivers/base/power/shutdown.c

This file was deleted.

0 comments on commit 37b0c02

Please sign in to comment.