From 594c8281f90560faf9632d91bb9d402cbe560e63 Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 5 Jan 2006 14:29:51 +0000 Subject: [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 Signed-off-by: Greg Kroah-Hartman --- drivers/base/driver.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/base/driver.c') 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) */ int driver_register(struct device_driver * drv) { + if ((drv->bus->probe && drv->probe) || + (drv->bus->remove && drv->remove) || + (drv->bus->shutdown && drv->shutdown)) { + printk(KERN_WARNING "Driver '%s' needs updating - please use bus_type methods\n", drv->name); + } klist_init(&drv->klist_devices, klist_devices_get, klist_devices_put); init_completion(&drv->unloaded); return bus_add_driver(drv); -- cgit v1.2.3