aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/digi_acceleport.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-02-23 14:56:32 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-24 15:39:18 -0500
commit97b6b6d2339f67eb17d954930a908b762af66228 (patch)
tree955eb92c831f444e26a930b3cd301393bb7112a0 /drivers/usb/serial/digi_acceleport.c
parent08a4f6bc2e7046ce50849d7589b7d0763926d808 (diff)
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.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index 2b1da0cc071..f0e776bb1ff 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 = {
276 .probe = usb_serial_probe, 276 .probe = usb_serial_probe,
277 .disconnect = usb_serial_disconnect, 277 .disconnect = usb_serial_disconnect,
278 .id_table = id_table_combined, 278 .id_table = id_table_combined,
279 .no_dynamic_id = 1,
280}; 279};
281 280
282 281
@@ -288,7 +287,6 @@ static struct usb_serial_driver digi_acceleport_2_device = {
288 .name = "digi_2", 287 .name = "digi_2",
289 }, 288 },
290 .description = "Digi 2 port USB adapter", 289 .description = "Digi 2 port USB adapter",
291 .usb_driver = &digi_driver,
292 .id_table = id_table_2, 290 .id_table = id_table_2,
293 .num_ports = 3, 291 .num_ports = 3,
294 .open = digi_open, 292 .open = digi_open,
@@ -316,7 +314,6 @@ static struct usb_serial_driver digi_acceleport_4_device = {
316 .name = "digi_4", 314 .name = "digi_4",
317 }, 315 },
318 .description = "Digi 4 port USB adapter", 316 .description = "Digi 4 port USB adapter",
319 .usb_driver = &digi_driver,
320 .id_table = id_table_4, 317 .id_table = id_table_4,
321 .num_ports = 4, 318 .num_ports = 4,
322 .open = digi_open, 319 .open = digi_open,
@@ -337,6 +334,9 @@ static struct usb_serial_driver digi_acceleport_4_device = {
337 .release = digi_release, 334 .release = digi_release,
338}; 335};
339 336
337static struct usb_serial_driver * const serial_drivers[] = {
338 &digi_acceleport_2_device, &digi_acceleport_4_device, NULL
339};
340 340
341/* Functions */ 341/* Functions */
342 342
@@ -1583,31 +1583,17 @@ static int digi_read_oob_callback(struct urb *urb)
1583static int __init digi_init(void) 1583static int __init digi_init(void)
1584{ 1584{
1585 int retval; 1585 int retval;
1586 retval = usb_serial_register(&digi_acceleport_2_device); 1586
1587 if (retval) 1587 retval = usb_serial_register_drivers(&digi_driver, serial_drivers);
1588 goto failed_acceleport_2_device; 1588 if (retval == 0)
1589 retval = usb_serial_register(&digi_acceleport_4_device); 1589 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
1590 if (retval) 1590 DRIVER_DESC "\n");
1591 goto failed_acceleport_4_device;
1592 retval = usb_register(&digi_driver);
1593 if (retval)
1594 goto failed_usb_register;
1595 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
1596 DRIVER_DESC "\n");
1597 return 0;
1598failed_usb_register:
1599 usb_serial_deregister(&digi_acceleport_4_device);
1600failed_acceleport_4_device:
1601 usb_serial_deregister(&digi_acceleport_2_device);
1602failed_acceleport_2_device:
1603 return retval; 1591 return retval;
1604} 1592}
1605 1593
1606static void __exit digi_exit (void) 1594static void __exit digi_exit (void)
1607{ 1595{
1608 usb_deregister(&digi_driver); 1596 usb_serial_deregister_drivers(&digi_driver, serial_drivers);
1609 usb_serial_deregister(&digi_acceleport_2_device);
1610 usb_serial_deregister(&digi_acceleport_4_device);
1611} 1597}
1612 1598
1613 1599