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/qcserial.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'drivers/usb/serial/qcserial.c') diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 400a59e4b0ed..bc690ae814d0 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c @@ -112,11 +112,6 @@ static const struct usb_device_id id_table[] = { }; MODULE_DEVICE_TABLE(usb, id_table); -static struct usb_driver qcdriver = { - .name = "qcserial", - .id_table = id_table, -}; - static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) { struct usb_wwan_intf_private *data; @@ -277,7 +272,7 @@ static struct usb_serial_driver * const serial_drivers[] = { &qcdevice, NULL }; -module_usb_serial_driver(qcdriver, serial_drivers); +module_usb_serial_driver(serial_drivers, id_table); MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); -- cgit v1.2.1