From 97b6b6d2339f67eb17d954930a908b762af66228 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Thu, 23 Feb 2012 14:56:32 -0500 Subject: usb-serial: use new registration API in [d-h]* drivers This patch (as1524) modifies the following usb-serial drivers to utilize the new usb_serial_{de}register_drivers() routines: digi_acceleport, empeg, ftdi_sio, funsoft, garmin_gps, and hp4x. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/digi_acceleport.c | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) (limited to 'drivers/usb/serial/digi_acceleport.c') diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index 2b1da0cc071a..f0e776bb1ffb 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c @@ -276,7 +276,6 @@ static struct usb_driver digi_driver = { .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table_combined, - .no_dynamic_id = 1, }; @@ -288,7 +287,6 @@ static struct usb_serial_driver digi_acceleport_2_device = { .name = "digi_2", }, .description = "Digi 2 port USB adapter", - .usb_driver = &digi_driver, .id_table = id_table_2, .num_ports = 3, .open = digi_open, @@ -316,7 +314,6 @@ static struct usb_serial_driver digi_acceleport_4_device = { .name = "digi_4", }, .description = "Digi 4 port USB adapter", - .usb_driver = &digi_driver, .id_table = id_table_4, .num_ports = 4, .open = digi_open, @@ -337,6 +334,9 @@ static struct usb_serial_driver digi_acceleport_4_device = { .release = digi_release, }; +static struct usb_serial_driver * const serial_drivers[] = { + &digi_acceleport_2_device, &digi_acceleport_4_device, NULL +}; /* Functions */ @@ -1583,31 +1583,17 @@ static int digi_read_oob_callback(struct urb *urb) static int __init digi_init(void) { int retval; - retval = usb_serial_register(&digi_acceleport_2_device); - if (retval) - goto failed_acceleport_2_device; - retval = usb_serial_register(&digi_acceleport_4_device); - if (retval) - goto failed_acceleport_4_device; - retval = usb_register(&digi_driver); - if (retval) - goto failed_usb_register; - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" - DRIVER_DESC "\n"); - return 0; -failed_usb_register: - usb_serial_deregister(&digi_acceleport_4_device); -failed_acceleport_4_device: - usb_serial_deregister(&digi_acceleport_2_device); -failed_acceleport_2_device: + + retval = usb_serial_register_drivers(&digi_driver, serial_drivers); + if (retval == 0) + printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" + DRIVER_DESC "\n"); return retval; } static void __exit digi_exit (void) { - usb_deregister(&digi_driver); - usb_serial_deregister(&digi_acceleport_2_device); - usb_serial_deregister(&digi_acceleport_4_device); + usb_serial_deregister_drivers(&digi_driver, serial_drivers); } -- cgit v1.2.3