diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-02-23 14:56:32 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-24 12:39:18 -0800 |
commit | 97b6b6d2339f67eb17d954930a908b762af66228 (patch) | |
tree | 955eb92c831f444e26a930b3cd301393bb7112a0 /drivers/usb/serial/digi_acceleport.c | |
parent | 08a4f6bc2e7046ce50849d7589b7d0763926d808 (diff) | |
download | linux-97b6b6d2339f67eb17d954930a908b762af66228.tar.gz linux-97b6b6d2339f67eb17d954930a908b762af66228.tar.bz2 linux-97b6b6d2339f67eb17d954930a908b762af66228.zip |
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 <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/digi_acceleport.c')
-rw-r--r-- | drivers/usb/serial/digi_acceleport.c | 32 |
1 files changed, 9 insertions, 23 deletions
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); } |