forked from luck/tmp_suning_uos_patched
USB: add the sysfs driver name to all modules
This adds the module name to all USB drivers, if they are built into the kernel or not. It will show up in /sys/modules/MODULE_NAME/drivers/ Cc: Kay Sievers <kay.sievers@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
4b315627e6
commit
80f745fb1b
@ -750,7 +750,8 @@ EXPORT_SYMBOL_GPL(usb_deregister_device_driver);
|
||||
* usb_register_dev() to enable that functionality. This function no longer
|
||||
* takes care of that.
|
||||
*/
|
||||
int usb_register_driver(struct usb_driver *new_driver, struct module *owner)
|
||||
int usb_register_driver(struct usb_driver *new_driver, struct module *owner,
|
||||
const char *mod_name)
|
||||
{
|
||||
int retval = 0;
|
||||
|
||||
@ -763,6 +764,7 @@ int usb_register_driver(struct usb_driver *new_driver, struct module *owner)
|
||||
new_driver->drvwrap.driver.probe = usb_probe_interface;
|
||||
new_driver->drvwrap.driver.remove = usb_unbind_interface;
|
||||
new_driver->drvwrap.driver.owner = owner;
|
||||
new_driver->drvwrap.driver.mod_name = mod_name;
|
||||
spin_lock_init(&new_driver->dynids.lock);
|
||||
INIT_LIST_HEAD(&new_driver->dynids.list);
|
||||
|
||||
|
@ -868,10 +868,11 @@ struct usb_class_driver {
|
||||
* use these in module_init()/module_exit()
|
||||
* and don't forget MODULE_DEVICE_TABLE(usb, ...)
|
||||
*/
|
||||
extern int usb_register_driver(struct usb_driver *, struct module *);
|
||||
extern int usb_register_driver(struct usb_driver *, struct module *,
|
||||
const char *);
|
||||
static inline int usb_register(struct usb_driver *driver)
|
||||
{
|
||||
return usb_register_driver(driver, THIS_MODULE);
|
||||
return usb_register_driver(driver, THIS_MODULE, KBUILD_MODNAME);
|
||||
}
|
||||
extern void usb_deregister(struct usb_driver *);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user