From 2143acc6dc79bdbff812f02a7dc5ab9d4fc81fc8 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 21 Nov 2005 14:53:03 -0800 Subject: [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 --- include/linux/usb.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/linux/usb.h') diff --git a/include/linux/usb.h b/include/linux/usb.h index 8d5829936bc4..3d05c63451a8 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -625,7 +625,11 @@ struct usb_class_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, -- cgit v1.2.2