}
/**
- * 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
* 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;
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);
return retval;
}
-EXPORT_SYMBOL_GPL(usb_register);
+EXPORT_SYMBOL_GPL(usb_register_driver);
/**
* usb_deregister - unregister a USB driver
* use these in module_init()/module_exit()
* and don't forget MODULE_DEVICE_TABLE(usb, ...)
*/
-extern int usb_register(struct usb_driver *);
+int usb_register_driver(struct usb_driver *, struct module *);
+static inline int usb_register(struct usb_driver *driver)
+{
+ return usb_register_driver(driver, THIS_MODULE);
+}
extern void usb_deregister(struct usb_driver *);
extern int usb_register_dev(struct usb_interface *intf,