[PATCH] Add bus_type probe, remove, shutdown methods.
Add bus_type probe, remove and shutdown methods to replace the corresponding methods in struct device_driver. This matches the way we handle the suspend/resume methods. Since the bus methods override the device_driver methods, warn if a device driver is registered whose methods will not be called. The long-term idea is to remove the device_driver methods entirely. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
bd37e5a951
commit
594c8281f9
@@ -40,7 +40,10 @@ void device_shutdown(void)
|
||||
down_write(&devices_subsys.rwsem);
|
||||
list_for_each_entry_reverse(dev, &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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user