diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2005-11-21 23:53:03 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-04 22:48:32 +0100 |
commit | 2143acc6dc79bdbff812f02a7dc5ab9d4fc81fc8 (patch) | |
tree | 523c2d57e412766bfc37b9ff6c22ff01108c92a5 /drivers | |
parent | [PATCH] USB: allow usb drivers to disable dynamic ids (diff) | |
download | linux-2143acc6dc79bdbff812f02a7dc5ab9d4fc81fc8.tar.xz linux-2143acc6dc79bdbff812f02a7dc5ab9d4fc81fc8.zip |
[PATCH] USB: make registering a usb driver automatically set the module owner
This fixes the driver that forgot to set the module owner up. Now we
can remove the unneeded pointer from the usb driver structure. The idea
for how to do this was from Al Viro, who did this for the PCI drivers.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/core/driver.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 5e65bc258e1b..bb139f06bcd6 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c @@ -404,8 +404,9 @@ int usb_device_match(struct device *dev, struct device_driver *drv) } /** - * usb_register - register a USB driver + * usb_register_driver - register a USB driver * @new_driver: USB operations for the driver + * @owner: module owner of this driver. * * Registers a USB driver with the USB core. The list of unattached * interfaces will be rescanned whenever a new driver is added, allowing @@ -416,7 +417,7 @@ int usb_device_match(struct device *dev, struct device_driver *drv) * usb_register_dev() to enable that functionality. This function no longer * takes care of that. */ -int usb_register(struct usb_driver *new_driver) +int usb_register_driver(struct usb_driver *new_driver, struct module *owner) { int retval = 0; @@ -427,7 +428,7 @@ int usb_register(struct usb_driver *new_driver) new_driver->driver.bus = &usb_bus_type; new_driver->driver.probe = usb_probe_interface; new_driver->driver.remove = usb_unbind_interface; - new_driver->driver.owner = new_driver->owner; + new_driver->driver.owner = owner; spin_lock_init(&new_driver->dynids.lock); INIT_LIST_HEAD(&new_driver->dynids.list); @@ -447,7 +448,7 @@ int usb_register(struct usb_driver *new_driver) return retval; } -EXPORT_SYMBOL_GPL(usb_register); +EXPORT_SYMBOL_GPL(usb_register_driver); /** * usb_deregister - unregister a USB driver |