From d6022129c2de4e47f258013743809a3da69edce4 Mon Sep 17 00:00:00 2001 From: Patrick Mochel Date: Mon, 3 Jun 2002 05:48:44 -0700 Subject: device model udpate: - make sure drv->devices is initialized on registration (from Peter Osterlund) - add remove_driver for forcing removal of driver There was a potential race with the module unload code. When a pci driver was unloaded, it would call pci_unregister_driver, which would simply call put_driver. If the driver's refcount wasn't 0, it wouldn't unbind it from devices, but the module unload would still continue. If something tried to access the driver later (since everyone thinks its still there), Bad Things would happen. This fixes it until there can be tighter integration between the device model and module unload code. --- include/linux/device.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/device.h b/include/linux/device.h index 2186f85a8beb..1c35f87abc9e 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -118,6 +118,7 @@ static inline struct device_driver * get_driver(struct device_driver * drv) } extern void put_driver(struct device_driver * drv); +extern void remove_driver(struct device_driver * drv); extern int driver_for_each_dev(struct device_driver * drv, void * data, int (*callback)(struct device * dev, void * data)); -- cgit v1.2.3