From 68e24113457e437b1576670f2419b77ed0531e9e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 8 May 2012 15:46:14 -0700 Subject: USB: serial: rework usb_serial_register/deregister_drivers() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reworks the usb_serial_register_drivers() and usb_serial_deregister_drivers() to not need a pointer to a struct usb_driver anymore. The usb_driver structure is now created dynamically and registered and unregistered as needed. This saves lines of code in each usb-serial driver. All in-kernel users of these functions were also fixed up at this time. The pl2303 driver was tested that everything worked properly. Thanks for the idea to do this from Alan Stern. Cc: Adhir Ramjiawan Cc: Alan Stern Cc: Al Borchers Cc: Aleksey Babahin Cc: Andrew Morton Cc: Andrew Worsley Cc: Bart Hartgers Cc: Bill Pemberton Cc: Dan Carpenter Cc: Dan Williams Cc: Donald Lee Cc: Eric Dumazet Cc: "Eric W. Biederman" Cc: Felipe Balbi Cc: Gary Brubaker Cc: Jesper Juhl Cc: Jiri Kosina Cc: Johan Hovold Cc: Julia Lawall Cc: Kautuk Consul Cc: Kuninori Morimoto Cc: Lonnie Mendez Cc: Matthias Bruestle and Harald Welte Cc: Matthias Urlichs Cc: Mauro Carvalho Chehab Cc: Michal Sroczynski Cc: "Michał Wróbel" Cc: Oliver Neukum Cc: Paul Gortmaker Cc: Peter Berger Cc: Preston Fick Cc: "Rafael J. Wysocki" Cc: Rigbert Hamisch Cc: Rusty Russell Cc: Simon Arlott Cc: Support Department Cc: Thomas Tuttle Cc: Uwe Bonnes Cc: Wang YanQing Cc: William Greathouse Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/spcp8x5.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'drivers/usb/serial/spcp8x5.c') diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c index 51e43ccef10c..1fc1cab5a4ad 100644 --- a/drivers/usb/serial/spcp8x5.c +++ b/drivers/usb/serial/spcp8x5.c @@ -151,12 +151,6 @@ enum spcp8x5_type { SPCP835_TYPE, }; -static struct usb_driver spcp8x5_driver = { - .name = "spcp8x5", - .id_table = id_table, -}; - - struct spcp8x5_private { spinlock_t lock; enum spcp8x5_type type; @@ -662,7 +656,7 @@ static struct usb_serial_driver * const serial_drivers[] = { &spcp8x5_device, NULL }; -module_usb_serial_driver(spcp8x5_driver, serial_drivers); +module_usb_serial_driver(serial_drivers, id_table); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_VERSION(DRIVER_VERSION); -- cgit v1.2.3