]> err.no Git - linux-2.6/commitdiff
USB: add the sysfs driver name to all modules
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 15 Jan 2007 19:50:02 +0000 (11:50 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 7 Feb 2007 18:37:12 +0000 (10:37 -0800)
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>
drivers/usb/core/driver.c
include/linux/usb.h

index d6eb5ce1dd1da70663a92f85e986010b6dc47d6e..d505926aa9ccc53e3325cdebdaece6b56d3957c7 100644 (file)
@@ -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);
 
index aab5b1b720218b36b8ecb602f1bf44931b8c9c31..733f38de49781748d3e20ba02da3bbe4368546ea 100644 (file)
@@ -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 *);