diff options
-rw-r--r-- | drivers/usb/serial/navman.c | 19 | ||||
-rw-r--r-- | drivers/usb/serial/omninet.c | 26 | ||||
-rw-r--r-- | drivers/usb/serial/opticon.c | 19 | ||||
-rw-r--r-- | drivers/usb/serial/option.c | 27 | ||||
-rw-r--r-- | drivers/usb/serial/oti6858.c | 19 | ||||
-rw-r--r-- | drivers/usb/serial/pl2303.c | 23 |
6 files changed, 45 insertions, 88 deletions
diff --git a/drivers/usb/serial/navman.c b/drivers/usb/serial/navman.c index b28f1db0195f..fd4b2c833c0b 100644 --- a/drivers/usb/serial/navman.c +++ b/drivers/usb/serial/navman.c | |||
@@ -35,7 +35,6 @@ static struct usb_driver navman_driver = { | |||
35 | .probe = usb_serial_probe, | 35 | .probe = usb_serial_probe, |
36 | .disconnect = usb_serial_disconnect, | 36 | .disconnect = usb_serial_disconnect, |
37 | .id_table = id_table, | 37 | .id_table = id_table, |
38 | .no_dynamic_id = 1, | ||
39 | }; | 38 | }; |
40 | 39 | ||
41 | static void navman_read_int_callback(struct urb *urb) | 40 | static void navman_read_int_callback(struct urb *urb) |
@@ -122,7 +121,6 @@ static struct usb_serial_driver navman_device = { | |||
122 | .name = "navman", | 121 | .name = "navman", |
123 | }, | 122 | }, |
124 | .id_table = id_table, | 123 | .id_table = id_table, |
125 | .usb_driver = &navman_driver, | ||
126 | .num_ports = 1, | 124 | .num_ports = 1, |
127 | .open = navman_open, | 125 | .open = navman_open, |
128 | .close = navman_close, | 126 | .close = navman_close, |
@@ -130,23 +128,18 @@ static struct usb_serial_driver navman_device = { | |||
130 | .read_int_callback = navman_read_int_callback, | 128 | .read_int_callback = navman_read_int_callback, |
131 | }; | 129 | }; |
132 | 130 | ||
131 | static struct usb_serial_driver * const serial_drivers[] = { | ||
132 | &navman_device, NULL | ||
133 | }; | ||
134 | |||
133 | static int __init navman_init(void) | 135 | static int __init navman_init(void) |
134 | { | 136 | { |
135 | int retval; | 137 | return usb_serial_register_drivers(&navman_driver, serial_drivers); |
136 | |||
137 | retval = usb_serial_register(&navman_device); | ||
138 | if (retval) | ||
139 | return retval; | ||
140 | retval = usb_register(&navman_driver); | ||
141 | if (retval) | ||
142 | usb_serial_deregister(&navman_device); | ||
143 | return retval; | ||
144 | } | 138 | } |
145 | 139 | ||
146 | static void __exit navman_exit(void) | 140 | static void __exit navman_exit(void) |
147 | { | 141 | { |
148 | usb_deregister(&navman_driver); | 142 | usb_serial_deregister_drivers(&navman_driver, serial_drivers); |
149 | usb_serial_deregister(&navman_device); | ||
150 | } | 143 | } |
151 | 144 | ||
152 | module_init(navman_init); | 145 | module_init(navman_init); |
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c index 033e8afa6c77..975d5c559ccb 100644 --- a/drivers/usb/serial/omninet.c +++ b/drivers/usb/serial/omninet.c | |||
@@ -62,7 +62,6 @@ static struct usb_driver omninet_driver = { | |||
62 | .probe = usb_serial_probe, | 62 | .probe = usb_serial_probe, |
63 | .disconnect = usb_serial_disconnect, | 63 | .disconnect = usb_serial_disconnect, |
64 | .id_table = id_table, | 64 | .id_table = id_table, |
65 | .no_dynamic_id = 1, | ||
66 | }; | 65 | }; |
67 | 66 | ||
68 | 67 | ||
@@ -72,7 +71,6 @@ static struct usb_serial_driver zyxel_omninet_device = { | |||
72 | .name = "omninet", | 71 | .name = "omninet", |
73 | }, | 72 | }, |
74 | .description = "ZyXEL - omni.net lcd plus usb", | 73 | .description = "ZyXEL - omni.net lcd plus usb", |
75 | .usb_driver = &omninet_driver, | ||
76 | .id_table = id_table, | 74 | .id_table = id_table, |
77 | .num_ports = 1, | 75 | .num_ports = 1, |
78 | .attach = omninet_attach, | 76 | .attach = omninet_attach, |
@@ -86,6 +84,10 @@ static struct usb_serial_driver zyxel_omninet_device = { | |||
86 | .release = omninet_release, | 84 | .release = omninet_release, |
87 | }; | 85 | }; |
88 | 86 | ||
87 | static struct usb_serial_driver * const serial_drivers[] = { | ||
88 | &zyxel_omninet_device, NULL | ||
89 | }; | ||
90 | |||
89 | 91 | ||
90 | /* The protocol. | 92 | /* The protocol. |
91 | * | 93 | * |
@@ -323,26 +325,18 @@ static void omninet_release(struct usb_serial *serial) | |||
323 | static int __init omninet_init(void) | 325 | static int __init omninet_init(void) |
324 | { | 326 | { |
325 | int retval; | 327 | int retval; |
326 | retval = usb_serial_register(&zyxel_omninet_device); | 328 | |
327 | if (retval) | 329 | retval = usb_serial_register_drivers(&omninet_driver, serial_drivers); |
328 | goto failed_usb_serial_register; | 330 | if (retval == 0) |
329 | retval = usb_register(&omninet_driver); | 331 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" |
330 | if (retval) | 332 | DRIVER_DESC "\n"); |
331 | goto failed_usb_register; | ||
332 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
333 | DRIVER_DESC "\n"); | ||
334 | return 0; | ||
335 | failed_usb_register: | ||
336 | usb_serial_deregister(&zyxel_omninet_device); | ||
337 | failed_usb_serial_register: | ||
338 | return retval; | 333 | return retval; |
339 | } | 334 | } |
340 | 335 | ||
341 | 336 | ||
342 | static void __exit omninet_exit(void) | 337 | static void __exit omninet_exit(void) |
343 | { | 338 | { |
344 | usb_deregister(&omninet_driver); | 339 | usb_serial_deregister_drivers(&omninet_driver, serial_drivers); |
345 | usb_serial_deregister(&zyxel_omninet_device); | ||
346 | } | 340 | } |
347 | 341 | ||
348 | 342 | ||
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c index 262ded9e076b..7001ad779b94 100644 --- a/drivers/usb/serial/opticon.c +++ b/drivers/usb/serial/opticon.c | |||
@@ -604,7 +604,6 @@ static struct usb_driver opticon_driver = { | |||
604 | .suspend = opticon_suspend, | 604 | .suspend = opticon_suspend, |
605 | .resume = opticon_resume, | 605 | .resume = opticon_resume, |
606 | .id_table = id_table, | 606 | .id_table = id_table, |
607 | .no_dynamic_id = 1, | ||
608 | }; | 607 | }; |
609 | 608 | ||
610 | static struct usb_serial_driver opticon_device = { | 609 | static struct usb_serial_driver opticon_device = { |
@@ -613,7 +612,6 @@ static struct usb_serial_driver opticon_device = { | |||
613 | .name = "opticon", | 612 | .name = "opticon", |
614 | }, | 613 | }, |
615 | .id_table = id_table, | 614 | .id_table = id_table, |
616 | .usb_driver = &opticon_driver, | ||
617 | .num_ports = 1, | 615 | .num_ports = 1, |
618 | .attach = opticon_startup, | 616 | .attach = opticon_startup, |
619 | .open = opticon_open, | 617 | .open = opticon_open, |
@@ -629,23 +627,18 @@ static struct usb_serial_driver opticon_device = { | |||
629 | .tiocmset = opticon_tiocmset, | 627 | .tiocmset = opticon_tiocmset, |
630 | }; | 628 | }; |
631 | 629 | ||
630 | static struct usb_serial_driver * const serial_drivers[] = { | ||
631 | &opticon_device, NULL | ||
632 | }; | ||
633 | |||
632 | static int __init opticon_init(void) | 634 | static int __init opticon_init(void) |
633 | { | 635 | { |
634 | int retval; | 636 | return usb_serial_register_drivers(&opticon_driver, serial_drivers); |
635 | |||
636 | retval = usb_serial_register(&opticon_device); | ||
637 | if (retval) | ||
638 | return retval; | ||
639 | retval = usb_register(&opticon_driver); | ||
640 | if (retval) | ||
641 | usb_serial_deregister(&opticon_device); | ||
642 | return retval; | ||
643 | } | 637 | } |
644 | 638 | ||
645 | static void __exit opticon_exit(void) | 639 | static void __exit opticon_exit(void) |
646 | { | 640 | { |
647 | usb_deregister(&opticon_driver); | 641 | usb_serial_deregister_drivers(&opticon_driver, serial_drivers); |
648 | usb_serial_deregister(&opticon_device); | ||
649 | } | 642 | } |
650 | 643 | ||
651 | module_init(opticon_init); | 644 | module_init(opticon_init); |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index b54afceb9611..138a7b98cda4 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -1212,7 +1212,6 @@ static struct usb_driver option_driver = { | |||
1212 | .supports_autosuspend = 1, | 1212 | .supports_autosuspend = 1, |
1213 | #endif | 1213 | #endif |
1214 | .id_table = option_ids, | 1214 | .id_table = option_ids, |
1215 | .no_dynamic_id = 1, | ||
1216 | }; | 1215 | }; |
1217 | 1216 | ||
1218 | /* The card has three separate interfaces, which the serial driver | 1217 | /* The card has three separate interfaces, which the serial driver |
@@ -1225,7 +1224,6 @@ static struct usb_serial_driver option_1port_device = { | |||
1225 | .name = "option1", | 1224 | .name = "option1", |
1226 | }, | 1225 | }, |
1227 | .description = "GSM modem (1-port)", | 1226 | .description = "GSM modem (1-port)", |
1228 | .usb_driver = &option_driver, | ||
1229 | .id_table = option_ids, | 1227 | .id_table = option_ids, |
1230 | .num_ports = 1, | 1228 | .num_ports = 1, |
1231 | .probe = option_probe, | 1229 | .probe = option_probe, |
@@ -1249,6 +1247,10 @@ static struct usb_serial_driver option_1port_device = { | |||
1249 | #endif | 1247 | #endif |
1250 | }; | 1248 | }; |
1251 | 1249 | ||
1250 | static struct usb_serial_driver * const serial_drivers[] = { | ||
1251 | &option_1port_device, NULL | ||
1252 | }; | ||
1253 | |||
1252 | static bool debug; | 1254 | static bool debug; |
1253 | 1255 | ||
1254 | /* per port private data */ | 1256 | /* per port private data */ |
@@ -1284,28 +1286,17 @@ struct option_port_private { | |||
1284 | static int __init option_init(void) | 1286 | static int __init option_init(void) |
1285 | { | 1287 | { |
1286 | int retval; | 1288 | int retval; |
1287 | retval = usb_serial_register(&option_1port_device); | ||
1288 | if (retval) | ||
1289 | goto failed_1port_device_register; | ||
1290 | retval = usb_register(&option_driver); | ||
1291 | if (retval) | ||
1292 | goto failed_driver_register; | ||
1293 | |||
1294 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
1295 | DRIVER_DESC "\n"); | ||
1296 | |||
1297 | return 0; | ||
1298 | 1289 | ||
1299 | failed_driver_register: | 1290 | retval = usb_serial_register_drivers(&option_driver, serial_drivers); |
1300 | usb_serial_deregister(&option_1port_device); | 1291 | if (retval == 0) |
1301 | failed_1port_device_register: | 1292 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" |
1293 | DRIVER_DESC "\n"); | ||
1302 | return retval; | 1294 | return retval; |
1303 | } | 1295 | } |
1304 | 1296 | ||
1305 | static void __exit option_exit(void) | 1297 | static void __exit option_exit(void) |
1306 | { | 1298 | { |
1307 | usb_deregister(&option_driver); | 1299 | usb_serial_deregister_drivers(&option_driver, serial_drivers); |
1308 | usb_serial_deregister(&option_1port_device); | ||
1309 | } | 1300 | } |
1310 | 1301 | ||
1311 | module_init(option_init); | 1302 | module_init(option_init); |
diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c index 343e626a06f8..53f2768c9a36 100644 --- a/drivers/usb/serial/oti6858.c +++ b/drivers/usb/serial/oti6858.c | |||
@@ -71,7 +71,6 @@ static struct usb_driver oti6858_driver = { | |||
71 | .probe = usb_serial_probe, | 71 | .probe = usb_serial_probe, |
72 | .disconnect = usb_serial_disconnect, | 72 | .disconnect = usb_serial_disconnect, |
73 | .id_table = id_table, | 73 | .id_table = id_table, |
74 | .no_dynamic_id = 1, | ||
75 | }; | 74 | }; |
76 | 75 | ||
77 | static bool debug; | 76 | static bool debug; |
@@ -157,7 +156,6 @@ static struct usb_serial_driver oti6858_device = { | |||
157 | .name = "oti6858", | 156 | .name = "oti6858", |
158 | }, | 157 | }, |
159 | .id_table = id_table, | 158 | .id_table = id_table, |
160 | .usb_driver = &oti6858_driver, | ||
161 | .num_ports = 1, | 159 | .num_ports = 1, |
162 | .open = oti6858_open, | 160 | .open = oti6858_open, |
163 | .close = oti6858_close, | 161 | .close = oti6858_close, |
@@ -176,6 +174,10 @@ static struct usb_serial_driver oti6858_device = { | |||
176 | .release = oti6858_release, | 174 | .release = oti6858_release, |
177 | }; | 175 | }; |
178 | 176 | ||
177 | static struct usb_serial_driver * const serial_drivers[] = { | ||
178 | &oti6858_device, NULL | ||
179 | }; | ||
180 | |||
179 | struct oti6858_private { | 181 | struct oti6858_private { |
180 | spinlock_t lock; | 182 | spinlock_t lock; |
181 | 183 | ||
@@ -960,21 +962,12 @@ static void oti6858_write_bulk_callback(struct urb *urb) | |||
960 | 962 | ||
961 | static int __init oti6858_init(void) | 963 | static int __init oti6858_init(void) |
962 | { | 964 | { |
963 | int retval; | 965 | return usb_serial_register_drivers(&oti6858_driver, serial_drivers); |
964 | |||
965 | retval = usb_serial_register(&oti6858_device); | ||
966 | if (retval == 0) { | ||
967 | retval = usb_register(&oti6858_driver); | ||
968 | if (retval) | ||
969 | usb_serial_deregister(&oti6858_device); | ||
970 | } | ||
971 | return retval; | ||
972 | } | 966 | } |
973 | 967 | ||
974 | static void __exit oti6858_exit(void) | 968 | static void __exit oti6858_exit(void) |
975 | { | 969 | { |
976 | usb_deregister(&oti6858_driver); | 970 | usb_serial_deregister_drivers(&oti6858_driver, serial_drivers); |
977 | usb_serial_deregister(&oti6858_device); | ||
978 | } | 971 | } |
979 | 972 | ||
980 | module_init(oti6858_init); | 973 | module_init(oti6858_init); |
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 3d8cda57ce7a..cc65d810c8f5 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c | |||
@@ -104,7 +104,6 @@ static struct usb_driver pl2303_driver = { | |||
104 | .id_table = id_table, | 104 | .id_table = id_table, |
105 | .suspend = usb_serial_suspend, | 105 | .suspend = usb_serial_suspend, |
106 | .resume = usb_serial_resume, | 106 | .resume = usb_serial_resume, |
107 | .no_dynamic_id = 1, | ||
108 | .supports_autosuspend = 1, | 107 | .supports_autosuspend = 1, |
109 | }; | 108 | }; |
110 | 109 | ||
@@ -834,7 +833,6 @@ static struct usb_serial_driver pl2303_device = { | |||
834 | .name = "pl2303", | 833 | .name = "pl2303", |
835 | }, | 834 | }, |
836 | .id_table = id_table, | 835 | .id_table = id_table, |
837 | .usb_driver = &pl2303_driver, | ||
838 | .num_ports = 1, | 836 | .num_ports = 1, |
839 | .bulk_in_size = 256, | 837 | .bulk_in_size = 256, |
840 | .bulk_out_size = 256, | 838 | .bulk_out_size = 256, |
@@ -853,28 +851,23 @@ static struct usb_serial_driver pl2303_device = { | |||
853 | .release = pl2303_release, | 851 | .release = pl2303_release, |
854 | }; | 852 | }; |
855 | 853 | ||
854 | static struct usb_serial_driver * const serial_drivers[] = { | ||
855 | &pl2303_device, NULL | ||
856 | }; | ||
857 | |||
856 | static int __init pl2303_init(void) | 858 | static int __init pl2303_init(void) |
857 | { | 859 | { |
858 | int retval; | 860 | int retval; |
859 | 861 | ||
860 | retval = usb_serial_register(&pl2303_device); | 862 | retval = usb_serial_register_drivers(&pl2303_driver, serial_drivers); |
861 | if (retval) | 863 | if (retval == 0) |
862 | goto failed_usb_serial_register; | 864 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n"); |
863 | retval = usb_register(&pl2303_driver); | ||
864 | if (retval) | ||
865 | goto failed_usb_register; | ||
866 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n"); | ||
867 | return 0; | ||
868 | failed_usb_register: | ||
869 | usb_serial_deregister(&pl2303_device); | ||
870 | failed_usb_serial_register: | ||
871 | return retval; | 865 | return retval; |
872 | } | 866 | } |
873 | 867 | ||
874 | static void __exit pl2303_exit(void) | 868 | static void __exit pl2303_exit(void) |
875 | { | 869 | { |
876 | usb_deregister(&pl2303_driver); | 870 | usb_serial_deregister_drivers(&pl2303_driver, serial_drivers); |
877 | usb_serial_deregister(&pl2303_device); | ||
878 | } | 871 | } |
879 | 872 | ||
880 | module_init(pl2303_init); | 873 | module_init(pl2303_init); |