aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/serial/io_edgeport.c41
-rw-r--r--drivers/usb/serial/io_tables.h10
-rw-r--r--drivers/usb/serial/io_ti.c33
-rw-r--r--drivers/usb/serial/ipaq.c28
-rw-r--r--drivers/usb/serial/ipw.c24
-rw-r--r--drivers/usb/serial/ir-usb.c30
-rw-r--r--drivers/usb/serial/iuu_phoenix.c26
7 files changed, 61 insertions, 131 deletions
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index 616b07862771..55afa233aacd 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -3189,35 +3189,12 @@ static int __init edgeport_init(void)
3189{ 3189{
3190 int retval; 3190 int retval;
3191 3191
3192 retval = usb_serial_register(&edgeport_2port_device); 3192 retval = usb_serial_register_drivers(&io_driver, serial_drivers);
3193 if (retval) 3193 if (retval == 0) {
3194 goto failed_2port_device_register; 3194 atomic_set(&CmdUrbs, 0);
3195 retval = usb_serial_register(&edgeport_4port_device); 3195 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
3196 if (retval) 3196 DRIVER_DESC "\n");
3197 goto failed_4port_device_register; 3197 }
3198 retval = usb_serial_register(&edgeport_8port_device);
3199 if (retval)
3200 goto failed_8port_device_register;
3201 retval = usb_serial_register(&epic_device);
3202 if (retval)
3203 goto failed_epic_device_register;
3204 retval = usb_register(&io_driver);
3205 if (retval)
3206 goto failed_usb_register;
3207 atomic_set(&CmdUrbs, 0);
3208 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
3209 DRIVER_DESC "\n");
3210 return 0;
3211
3212failed_usb_register:
3213 usb_serial_deregister(&epic_device);
3214failed_epic_device_register:
3215 usb_serial_deregister(&edgeport_8port_device);
3216failed_8port_device_register:
3217 usb_serial_deregister(&edgeport_4port_device);
3218failed_4port_device_register:
3219 usb_serial_deregister(&edgeport_2port_device);
3220failed_2port_device_register:
3221 return retval; 3198 return retval;
3222} 3199}
3223 3200
@@ -3228,11 +3205,7 @@ failed_2port_device_register:
3228 ****************************************************************************/ 3205 ****************************************************************************/
3229static void __exit edgeport_exit (void) 3206static void __exit edgeport_exit (void)
3230{ 3207{
3231 usb_deregister(&io_driver); 3208 usb_serial_deregister_drivers(&io_driver, serial_drivers);
3232 usb_serial_deregister(&edgeport_2port_device);
3233 usb_serial_deregister(&edgeport_4port_device);
3234 usb_serial_deregister(&edgeport_8port_device);
3235 usb_serial_deregister(&epic_device);
3236} 3209}
3237 3210
3238module_init(edgeport_init); 3211module_init(edgeport_init);
diff --git a/drivers/usb/serial/io_tables.h b/drivers/usb/serial/io_tables.h
index 178b22eb32b1..d0e7c9affb6f 100644
--- a/drivers/usb/serial/io_tables.h
+++ b/drivers/usb/serial/io_tables.h
@@ -100,7 +100,6 @@ static struct usb_driver io_driver = {
100 .probe = usb_serial_probe, 100 .probe = usb_serial_probe,
101 .disconnect = usb_serial_disconnect, 101 .disconnect = usb_serial_disconnect,
102 .id_table = id_table_combined, 102 .id_table = id_table_combined,
103 .no_dynamic_id = 1,
104}; 103};
105 104
106static struct usb_serial_driver edgeport_2port_device = { 105static struct usb_serial_driver edgeport_2port_device = {
@@ -109,7 +108,6 @@ static struct usb_serial_driver edgeport_2port_device = {
109 .name = "edgeport_2", 108 .name = "edgeport_2",
110 }, 109 },
111 .description = "Edgeport 2 port adapter", 110 .description = "Edgeport 2 port adapter",
112 .usb_driver = &io_driver,
113 .id_table = edgeport_2port_id_table, 111 .id_table = edgeport_2port_id_table,
114 .num_ports = 2, 112 .num_ports = 2,
115 .open = edge_open, 113 .open = edge_open,
@@ -139,7 +137,6 @@ static struct usb_serial_driver edgeport_4port_device = {
139 .name = "edgeport_4", 137 .name = "edgeport_4",
140 }, 138 },
141 .description = "Edgeport 4 port adapter", 139 .description = "Edgeport 4 port adapter",
142 .usb_driver = &io_driver,
143 .id_table = edgeport_4port_id_table, 140 .id_table = edgeport_4port_id_table,
144 .num_ports = 4, 141 .num_ports = 4,
145 .open = edge_open, 142 .open = edge_open,
@@ -169,7 +166,6 @@ static struct usb_serial_driver edgeport_8port_device = {
169 .name = "edgeport_8", 166 .name = "edgeport_8",
170 }, 167 },
171 .description = "Edgeport 8 port adapter", 168 .description = "Edgeport 8 port adapter",
172 .usb_driver = &io_driver,
173 .id_table = edgeport_8port_id_table, 169 .id_table = edgeport_8port_id_table,
174 .num_ports = 8, 170 .num_ports = 8,
175 .open = edge_open, 171 .open = edge_open,
@@ -199,7 +195,6 @@ static struct usb_serial_driver epic_device = {
199 .name = "epic", 195 .name = "epic",
200 }, 196 },
201 .description = "EPiC device", 197 .description = "EPiC device",
202 .usb_driver = &io_driver,
203 .id_table = Epic_port_id_table, 198 .id_table = Epic_port_id_table,
204 .num_ports = 1, 199 .num_ports = 1,
205 .open = edge_open, 200 .open = edge_open,
@@ -223,5 +218,10 @@ static struct usb_serial_driver epic_device = {
223 .write_bulk_callback = edge_bulk_out_data_callback, 218 .write_bulk_callback = edge_bulk_out_data_callback,
224}; 219};
225 220
221static struct usb_serial_driver * const serial_drivers[] = {
222 &edgeport_2port_device, &edgeport_4port_device,
223 &edgeport_8port_device, &epic_device, NULL
224};
225
226#endif 226#endif
227 227
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 58a3697246a8..484db3331f88 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -202,7 +202,6 @@ static struct usb_driver io_driver = {
202 .probe = usb_serial_probe, 202 .probe = usb_serial_probe,
203 .disconnect = usb_serial_disconnect, 203 .disconnect = usb_serial_disconnect,
204 .id_table = id_table_combined, 204 .id_table = id_table_combined,
205 .no_dynamic_id = 1,
206}; 205};
207 206
208 207
@@ -2725,7 +2724,6 @@ static struct usb_serial_driver edgeport_1port_device = {
2725 .name = "edgeport_ti_1", 2724 .name = "edgeport_ti_1",
2726 }, 2725 },
2727 .description = "Edgeport TI 1 port adapter", 2726 .description = "Edgeport TI 1 port adapter",
2728 .usb_driver = &io_driver,
2729 .id_table = edgeport_1port_id_table, 2727 .id_table = edgeport_1port_id_table,
2730 .num_ports = 1, 2728 .num_ports = 1,
2731 .open = edge_open, 2729 .open = edge_open,
@@ -2757,7 +2755,6 @@ static struct usb_serial_driver edgeport_2port_device = {
2757 .name = "edgeport_ti_2", 2755 .name = "edgeport_ti_2",
2758 }, 2756 },
2759 .description = "Edgeport TI 2 port adapter", 2757 .description = "Edgeport TI 2 port adapter",
2760 .usb_driver = &io_driver,
2761 .id_table = edgeport_2port_id_table, 2758 .id_table = edgeport_2port_id_table,
2762 .num_ports = 2, 2759 .num_ports = 2,
2763 .open = edge_open, 2760 .open = edge_open,
@@ -2782,35 +2779,25 @@ static struct usb_serial_driver edgeport_2port_device = {
2782 .write_bulk_callback = edge_bulk_out_callback, 2779 .write_bulk_callback = edge_bulk_out_callback,
2783}; 2780};
2784 2781
2782static struct usb_serial_driver * const serial_drivers[] = {
2783 &edgeport_1port_device, &edgeport_2port_device, NULL
2784};
2785
2785 2786
2786static int __init edgeport_init(void) 2787static int __init edgeport_init(void)
2787{ 2788{
2788 int retval; 2789 int retval;
2789 retval = usb_serial_register(&edgeport_1port_device); 2790
2790 if (retval) 2791 retval = usb_serial_register_drivers(&io_driver, serial_drivers);
2791 goto failed_1port_device_register; 2792 if (retval == 0)
2792 retval = usb_serial_register(&edgeport_2port_device); 2793 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
2793 if (retval) 2794 DRIVER_DESC "\n");
2794 goto failed_2port_device_register;
2795 retval = usb_register(&io_driver);
2796 if (retval)
2797 goto failed_usb_register;
2798 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
2799 DRIVER_DESC "\n");
2800 return 0;
2801failed_usb_register:
2802 usb_serial_deregister(&edgeport_2port_device);
2803failed_2port_device_register:
2804 usb_serial_deregister(&edgeport_1port_device);
2805failed_1port_device_register:
2806 return retval; 2795 return retval;
2807} 2796}
2808 2797
2809static void __exit edgeport_exit(void) 2798static void __exit edgeport_exit(void)
2810{ 2799{
2811 usb_deregister(&io_driver); 2800 usb_serial_deregister_drivers(&io_driver, serial_drivers);
2812 usb_serial_deregister(&edgeport_1port_device);
2813 usb_serial_deregister(&edgeport_2port_device);
2814} 2801}
2815 2802
2816module_init(edgeport_init); 2803module_init(edgeport_init);
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index 06053a920dd8..10c02b8b5664 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -510,7 +510,6 @@ static struct usb_driver ipaq_driver = {
510 .probe = usb_serial_probe, 510 .probe = usb_serial_probe,
511 .disconnect = usb_serial_disconnect, 511 .disconnect = usb_serial_disconnect,
512 .id_table = ipaq_id_table, 512 .id_table = ipaq_id_table,
513 .no_dynamic_id = 1,
514}; 513};
515 514
516 515
@@ -521,7 +520,6 @@ static struct usb_serial_driver ipaq_device = {
521 .name = "ipaq", 520 .name = "ipaq",
522 }, 521 },
523 .description = "PocketPC PDA", 522 .description = "PocketPC PDA",
524 .usb_driver = &ipaq_driver,
525 .id_table = ipaq_id_table, 523 .id_table = ipaq_id_table,
526 .bulk_in_size = 256, 524 .bulk_in_size = 256,
527 .bulk_out_size = 256, 525 .bulk_out_size = 256,
@@ -530,6 +528,10 @@ static struct usb_serial_driver ipaq_device = {
530 .calc_num_ports = ipaq_calc_num_ports, 528 .calc_num_ports = ipaq_calc_num_ports,
531}; 529};
532 530
531static struct usb_serial_driver * const serial_drivers[] = {
532 &ipaq_device, NULL
533};
534
533static int ipaq_open(struct tty_struct *tty, 535static int ipaq_open(struct tty_struct *tty,
534 struct usb_serial_port *port) 536 struct usb_serial_port *port)
535{ 537{
@@ -624,30 +626,22 @@ static int ipaq_startup(struct usb_serial *serial)
624static int __init ipaq_init(void) 626static int __init ipaq_init(void)
625{ 627{
626 int retval; 628 int retval;
627 retval = usb_serial_register(&ipaq_device); 629
628 if (retval)
629 goto failed_usb_serial_register;
630 if (vendor) { 630 if (vendor) {
631 ipaq_id_table[0].idVendor = vendor; 631 ipaq_id_table[0].idVendor = vendor;
632 ipaq_id_table[0].idProduct = product; 632 ipaq_id_table[0].idProduct = product;
633 } 633 }
634 retval = usb_register(&ipaq_driver); 634
635 if (retval) 635 retval = usb_serial_register_drivers(&ipaq_driver, serial_drivers);
636 goto failed_usb_register; 636 if (retval == 0)
637 637 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
638 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" 638 DRIVER_DESC "\n");
639 DRIVER_DESC "\n");
640 return 0;
641failed_usb_register:
642 usb_serial_deregister(&ipaq_device);
643failed_usb_serial_register:
644 return retval; 639 return retval;
645} 640}
646 641
647static void __exit ipaq_exit(void) 642static void __exit ipaq_exit(void)
648{ 643{
649 usb_deregister(&ipaq_driver); 644 usb_serial_deregister_drivers(&ipaq_driver, serial_drivers);
650 usb_serial_deregister(&ipaq_device);
651} 645}
652 646
653 647
diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c
index 6f9356f3f99e..27b8886f1055 100644
--- a/drivers/usb/serial/ipw.c
+++ b/drivers/usb/serial/ipw.c
@@ -144,7 +144,6 @@ static struct usb_driver usb_ipw_driver = {
144 .probe = usb_serial_probe, 144 .probe = usb_serial_probe,
145 .disconnect = usb_serial_disconnect, 145 .disconnect = usb_serial_disconnect,
146 .id_table = usb_ipw_ids, 146 .id_table = usb_ipw_ids,
147 .no_dynamic_id = 1,
148}; 147};
149 148
150static bool debug; 149static bool debug;
@@ -318,7 +317,6 @@ static struct usb_serial_driver ipw_device = {
318 .name = "ipw", 317 .name = "ipw",
319 }, 318 },
320 .description = "IPWireless converter", 319 .description = "IPWireless converter",
321 .usb_driver = &usb_ipw_driver,
322 .id_table = usb_ipw_ids, 320 .id_table = usb_ipw_ids,
323 .num_ports = 1, 321 .num_ports = 1,
324 .disconnect = usb_wwan_disconnect, 322 .disconnect = usb_wwan_disconnect,
@@ -331,29 +329,25 @@ static struct usb_serial_driver ipw_device = {
331 .write = usb_wwan_write, 329 .write = usb_wwan_write,
332}; 330};
333 331
332static struct usb_serial_driver * const serial_drivers[] = {
333 &ipw_device, NULL
334};
334 335
335 336
336static int __init usb_ipw_init(void) 337static int __init usb_ipw_init(void)
337{ 338{
338 int retval; 339 int retval;
339 340
340 retval = usb_serial_register(&ipw_device); 341 retval = usb_serial_register_drivers(&usb_ipw_driver, serial_drivers);
341 if (retval) 342 if (retval == 0)
342 return retval; 343 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
343 retval = usb_register(&usb_ipw_driver); 344 DRIVER_DESC "\n");
344 if (retval) { 345 return retval;
345 usb_serial_deregister(&ipw_device);
346 return retval;
347 }
348 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
349 DRIVER_DESC "\n");
350 return 0;
351} 346}
352 347
353static void __exit usb_ipw_exit(void) 348static void __exit usb_ipw_exit(void)
354{ 349{
355 usb_deregister(&usb_ipw_driver); 350 usb_serial_deregister_drivers(&usb_ipw_driver, serial_drivers);
356 usb_serial_deregister(&ipw_device);
357} 351}
358 352
359module_init(usb_ipw_init); 353module_init(usb_ipw_init);
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
index 84a396e83671..84965cd65c76 100644
--- a/drivers/usb/serial/ir-usb.c
+++ b/drivers/usb/serial/ir-usb.c
@@ -82,7 +82,6 @@ static struct usb_driver ir_driver = {
82 .probe = usb_serial_probe, 82 .probe = usb_serial_probe,
83 .disconnect = usb_serial_disconnect, 83 .disconnect = usb_serial_disconnect,
84 .id_table = ir_id_table, 84 .id_table = ir_id_table,
85 .no_dynamic_id = 1,
86}; 85};
87 86
88static struct usb_serial_driver ir_device = { 87static struct usb_serial_driver ir_device = {
@@ -91,7 +90,6 @@ static struct usb_serial_driver ir_device = {
91 .name = "ir-usb", 90 .name = "ir-usb",
92 }, 91 },
93 .description = "IR Dongle", 92 .description = "IR Dongle",
94 .usb_driver = &ir_driver,
95 .id_table = ir_id_table, 93 .id_table = ir_id_table,
96 .num_ports = 1, 94 .num_ports = 1,
97 .set_termios = ir_set_termios, 95 .set_termios = ir_set_termios,
@@ -101,6 +99,10 @@ static struct usb_serial_driver ir_device = {
101 .process_read_urb = ir_process_read_urb, 99 .process_read_urb = ir_process_read_urb,
102}; 100};
103 101
102static struct usb_serial_driver * const serial_drivers[] = {
103 &ir_device, NULL
104};
105
104static inline void irda_usb_dump_class_desc(struct usb_irda_cs_descriptor *desc) 106static inline void irda_usb_dump_class_desc(struct usb_irda_cs_descriptor *desc)
105{ 107{
106 dbg("bLength=%x", desc->bLength); 108 dbg("bLength=%x", desc->bLength);
@@ -445,30 +447,16 @@ static int __init ir_init(void)
445 ir_device.bulk_out_size = buffer_size; 447 ir_device.bulk_out_size = buffer_size;
446 } 448 }
447 449
448 retval = usb_serial_register(&ir_device); 450 retval = usb_serial_register_drivers(&ir_driver, serial_drivers);
449 if (retval) 451 if (retval == 0)
450 goto failed_usb_serial_register; 452 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
451 453 DRIVER_DESC "\n");
452 retval = usb_register(&ir_driver);
453 if (retval)
454 goto failed_usb_register;
455
456 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
457 DRIVER_DESC "\n");
458
459 return 0;
460
461failed_usb_register:
462 usb_serial_deregister(&ir_device);
463
464failed_usb_serial_register:
465 return retval; 454 return retval;
466} 455}
467 456
468static void __exit ir_exit(void) 457static void __exit ir_exit(void)
469{ 458{
470 usb_deregister(&ir_driver); 459 usb_serial_deregister_drivers(&ir_driver, serial_drivers);
471 usb_serial_deregister(&ir_device);
472} 460}
473 461
474 462
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c
index 3077a4436976..97a7ea2a5e4f 100644
--- a/drivers/usb/serial/iuu_phoenix.c
+++ b/drivers/usb/serial/iuu_phoenix.c
@@ -56,7 +56,6 @@ static struct usb_driver iuu_driver = {
56 .probe = usb_serial_probe, 56 .probe = usb_serial_probe,
57 .disconnect = usb_serial_disconnect, 57 .disconnect = usb_serial_disconnect,
58 .id_table = id_table, 58 .id_table = id_table,
59 .no_dynamic_id = 1,
60}; 59};
61 60
62/* turbo parameter */ 61/* turbo parameter */
@@ -1274,7 +1273,6 @@ static struct usb_serial_driver iuu_device = {
1274 .name = "iuu_phoenix", 1273 .name = "iuu_phoenix",
1275 }, 1274 },
1276 .id_table = id_table, 1275 .id_table = id_table,
1277 .usb_driver = &iuu_driver,
1278 .num_ports = 1, 1276 .num_ports = 1,
1279 .bulk_in_size = 512, 1277 .bulk_in_size = 512,
1280 .bulk_out_size = 512, 1278 .bulk_out_size = 512,
@@ -1292,28 +1290,24 @@ static struct usb_serial_driver iuu_device = {
1292 .release = iuu_release, 1290 .release = iuu_release,
1293}; 1291};
1294 1292
1293static struct usb_serial_driver * const serial_drivers[] = {
1294 &iuu_device, NULL
1295};
1296
1295static int __init iuu_init(void) 1297static int __init iuu_init(void)
1296{ 1298{
1297 int retval; 1299 int retval;
1298 retval = usb_serial_register(&iuu_device); 1300
1299 if (retval) 1301 retval = usb_serial_register_drivers(&iuu_driver, serial_drivers);
1300 goto failed_usb_serial_register; 1302 if (retval == 0)
1301 retval = usb_register(&iuu_driver); 1303 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
1302 if (retval) 1304 DRIVER_DESC "\n");
1303 goto failed_usb_register;
1304 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
1305 DRIVER_DESC "\n");
1306 return 0;
1307failed_usb_register:
1308 usb_serial_deregister(&iuu_device);
1309failed_usb_serial_register:
1310 return retval; 1305 return retval;
1311} 1306}
1312 1307
1313static void __exit iuu_exit(void) 1308static void __exit iuu_exit(void)
1314{ 1309{
1315 usb_deregister(&iuu_driver); 1310 usb_serial_deregister_drivers(&iuu_driver, serial_drivers);
1316 usb_serial_deregister(&iuu_device);
1317} 1311}
1318 1312
1319module_init(iuu_init); 1313module_init(iuu_init);