aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/driver.c
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2006-01-05 09:29:51 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-13 14:26:04 -0500
commit594c8281f90560faf9632d91bb9d402cbe560e63 (patch)
treeabeb32df086cfd204accad33b11040381c31689d /drivers/base/driver.c
parentbd37e5a951ad2123d3f51f59c407b5242946b6ba (diff)
[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>
Diffstat (limited to 'drivers/base/driver.c')
-rw-r--r--drivers/base/driver.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 161f3a390d90..b400314e1c62 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -171,6 +171,11 @@ static void klist_devices_put(struct klist_node *n)
171 */ 171 */
172int driver_register(struct device_driver * drv) 172int driver_register(struct device_driver * drv)
173{ 173{
174 if ((drv->bus->probe && drv->probe) ||
175 (drv->bus->remove && drv->remove) ||
176 (drv->bus->shutdown && drv->shutdown)) {
177 printk(KERN_WARNING "Driver '%s' needs updating - please use bus_type methods\n", drv->name);
178 }
174 klist_init(&drv->klist_devices, klist_devices_get, klist_devices_put); 179 klist_init(&drv->klist_devices, klist_devices_get, klist_devices_put);
175 init_completion(&drv->unloaded); 180 init_completion(&drv->unloaded);
176 return bus_add_driver(drv); 181 return bus_add_driver(drv);