X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fbase%2Fdriver.c;h=eb11475293ed614ea381589296db607381099cc2;hb=2843483d2eb02ad104edbe8b2429fb6a39d25063;hp=b400314e1c62d46d9d2dc047cb76a08292b7f9ff;hpb=cf41f8ac386e8d62122e7e394b4c6b3e3ab30ede;p=linux-2.6 diff --git a/drivers/base/driver.c b/drivers/base/driver.c index b400314e1c..eb11475293 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -8,7 +8,6 @@ * */ -#include #include #include #include @@ -143,20 +142,6 @@ void put_driver(struct device_driver * drv) kobject_put(&drv->kobj); } -static void klist_devices_get(struct klist_node *n) -{ - struct device *dev = container_of(n, struct device, knode_driver); - - get_device(dev); -} - -static void klist_devices_put(struct klist_node *n) -{ - struct device *dev = container_of(n, struct device, knode_driver); - - put_device(dev); -} - /** * driver_register - register driver with bus * @drv: driver to register @@ -164,10 +149,6 @@ static void klist_devices_put(struct klist_node *n) * We pass off most of the work to the bus_add_driver() call, * since most of the things we have to do deal with the bus * structures. - * - * The one interesting aspect is that we setup @drv->unloaded - * as a completion that gets complete when the driver reference - * count reaches 0. */ int driver_register(struct device_driver * drv) { @@ -176,29 +157,20 @@ int driver_register(struct device_driver * drv) (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); + klist_init(&drv->klist_devices, NULL, NULL); return bus_add_driver(drv); } - /** * driver_unregister - remove driver from system. * @drv: driver. * * Again, we pass off most of the work to the bus-level call. - * - * Though, once that is done, we wait until @drv->unloaded is completed. - * This will block until the driver refcount reaches 0, and it is - * released. Only modular drivers will call this function, and we - * have to guarantee that it won't complete, letting the driver - * unload until all references are gone. */ void driver_unregister(struct device_driver * drv) { bus_remove_driver(drv); - wait_for_completion(&drv->unloaded); } /**