aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-08 18:46:14 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-08 18:46:14 -0400
commit68e24113457e437b1576670f2419b77ed0531e9e (patch)
tree4737e411b3df714ff1a2c911dbc66d0ba5e5cf5b
parentd56ba3205fe2e61264ef41f29cd90a666df032e4 (diff)
USB: serial: rework usb_serial_register/deregister_drivers()
This reworks the usb_serial_register_drivers() and usb_serial_deregister_drivers() to not need a pointer to a struct usb_driver anymore. The usb_driver structure is now created dynamically and registered and unregistered as needed. This saves lines of code in each usb-serial driver. All in-kernel users of these functions were also fixed up at this time. The pl2303 driver was tested that everything worked properly. Thanks for the idea to do this from Alan Stern. Cc: Adhir Ramjiawan <adhirramjiawan0@gmail.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Al Borchers <alborchers@steinerpoint.com> Cc: Aleksey Babahin <tamerlan311@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andrew Worsley <amworsley@gmail.com> Cc: Bart Hartgers <bart.hartgers@gmail.com> Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Dan Carpenter <error27@gmail.com> Cc: Dan Williams <dcbw@redhat.com> Cc: Donald Lee <donald@asix.com.tw> Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Felipe Balbi <balbi@ti.com> Cc: Gary Brubaker <xavyer@ix.netcom.com> Cc: Jesper Juhl <jj@chaosbits.net> Cc: Jiri Kosina <jkosina@suse.cz> Cc: Johan Hovold <jhovold@gmail.com> Cc: Julia Lawall <julia@diku.dk> Cc: Kautuk Consul <consul.kautuk@gmail.com> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Cc: Lonnie Mendez <dignome@gmail.com> Cc: Matthias Bruestle and Harald Welte <support@reiner-sct.com> Cc: Matthias Urlichs <smurf@smurf.noris.de> Cc: Mauro Carvalho Chehab <mchehab@redhat.com> Cc: Michal Sroczynski <msroczyn@gmail.com> Cc: "Michał Wróbel" <michal.wrobel@flytronic.pl> Cc: Oliver Neukum <oliver@neukum.name> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Peter Berger <pberger@brimson.com> Cc: Preston Fick <preston.fick@silabs.com> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Rigbert Hamisch <rigbert@gmx.de> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Simon Arlott <simon@fire.lp0.eu> Cc: Support Department <support@connecttech.com> Cc: Thomas Tuttle <ttuttle@chromium.org> Cc: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de> Cc: Wang YanQing <Udknight@gmail.com> Cc: William Greathouse <wgreathouse@smva.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/quatech_usb2/quatech_usb2.c15
-rw-r--r--drivers/staging/serqt_usb2/serqt_usb2.c14
-rw-r--r--drivers/usb/serial/aircable.c7
-rw-r--r--drivers/usb/serial/ark3116.c7
-rw-r--r--drivers/usb/serial/belkin_sa.c13
-rw-r--r--drivers/usb/serial/ch341.c7
-rw-r--r--drivers/usb/serial/cp210x.c7
-rw-r--r--drivers/usb/serial/cyberjack.c7
-rw-r--r--drivers/usb/serial/cypress_m8.c7
-rw-r--r--drivers/usb/serial/digi_acceleport.c8
-rw-r--r--drivers/usb/serial/empeg.c7
-rw-r--r--drivers/usb/serial/f81232.c8
-rw-r--r--drivers/usb/serial/ftdi_sio.c9
-rw-r--r--drivers/usb/serial/funsoft.c7
-rw-r--r--drivers/usb/serial/garmin_gps.c8
-rw-r--r--drivers/usb/serial/generic.c9
-rw-r--r--drivers/usb/serial/hp4x.c7
-rw-r--r--drivers/usb/serial/io_edgeport.c2
-rw-r--r--drivers/usb/serial/io_tables.h5
-rw-r--r--drivers/usb/serial/io_ti.c8
-rw-r--r--drivers/usb/serial/ipaq.c7
-rw-r--r--drivers/usb/serial/ipw.c14
-rw-r--r--drivers/usb/serial/ir-usb.c9
-rw-r--r--drivers/usb/serial/iuu_phoenix.c7
-rw-r--r--drivers/usb/serial/keyspan.c2
-rw-r--r--drivers/usb/serial/keyspan.h5
-rw-r--r--drivers/usb/serial/keyspan_pda.c7
-rw-r--r--drivers/usb/serial/kl5kusb105.c7
-rw-r--r--drivers/usb/serial/kobil_sct.c10
-rw-r--r--drivers/usb/serial/mct_u232.c14
-rw-r--r--drivers/usb/serial/metro-usb.c7
-rw-r--r--drivers/usb/serial/mos7720.c13
-rw-r--r--drivers/usb/serial/mos7840.c39
-rw-r--r--drivers/usb/serial/moto_modem.c7
-rw-r--r--drivers/usb/serial/navman.c7
-rw-r--r--drivers/usb/serial/omninet.c9
-rw-r--r--drivers/usb/serial/opticon.c2
-rw-r--r--drivers/usb/serial/option.c7
-rw-r--r--drivers/usb/serial/oti6858.c7
-rw-r--r--drivers/usb/serial/pl2303.c7
-rw-r--r--drivers/usb/serial/qcaux.c7
-rw-r--r--drivers/usb/serial/qcserial.c7
-rw-r--r--drivers/usb/serial/safe_serial.c9
-rw-r--r--drivers/usb/serial/siemens_mpi.c7
-rw-r--r--drivers/usb/serial/sierra.c7
-rw-r--r--drivers/usb/serial/spcp8x5.c8
-rw-r--r--drivers/usb/serial/ssu100.c9
-rw-r--r--drivers/usb/serial/symbolserial.c7
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.c11
-rw-r--r--drivers/usb/serial/usb-serial.c38
-rw-r--r--drivers/usb/serial/usb_debug.c7
-rw-r--r--drivers/usb/serial/visor.c7
-rw-r--r--drivers/usb/serial/vivopay-serial.c7
-rw-r--r--drivers/usb/serial/whiteheat.c6
-rw-r--r--drivers/usb/serial/zio.c7
-rw-r--r--include/linux/usb/serial.h27
56 files changed, 120 insertions, 400 deletions
diff --git a/drivers/staging/quatech_usb2/quatech_usb2.c b/drivers/staging/quatech_usb2/quatech_usb2.c
index 4e9c00e53261..a977acaf73c1 100644
--- a/drivers/staging/quatech_usb2/quatech_usb2.c
+++ b/drivers/staging/quatech_usb2/quatech_usb2.c
@@ -116,7 +116,7 @@ static bool debug;
116#define FOURTHCHAR ((unsigned char *)(urb->transfer_buffer))[i + 3] 116#define FOURTHCHAR ((unsigned char *)(urb->transfer_buffer))[i + 3]
117#define FIFTHCHAR ((unsigned char *)(urb->transfer_buffer))[i + 4] 117#define FIFTHCHAR ((unsigned char *)(urb->transfer_buffer))[i + 4]
118 118
119static const struct usb_device_id quausb2_id_table[] = { 119static const struct usb_device_id id_table[] = {
120 {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_SSU2_100)}, 120 {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_SSU2_100)},
121 {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_DSU2_100)}, 121 {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_DSU2_100)},
122 {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_DSU2_400)}, 122 {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_DSU2_400)},
@@ -126,14 +126,7 @@ static const struct usb_device_id quausb2_id_table[] = {
126 {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_ESU2_400)}, 126 {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_ESU2_400)},
127 {} /* Terminating entry */ 127 {} /* Terminating entry */
128}; 128};
129 129MODULE_DEVICE_TABLE(usb, id_table);
130MODULE_DEVICE_TABLE(usb, quausb2_id_table);
131
132/* custom structures we need go here */
133static struct usb_driver quausb2_usb_driver = {
134 .name = "quatech-usb2-serial",
135 .id_table = quausb2_id_table,
136};
137 130
138/** 131/**
139 * quatech2_port: Structure in which to keep all the messy stuff that this 132 * quatech2_port: Structure in which to keep all the messy stuff that this
@@ -1922,7 +1915,7 @@ static struct usb_serial_driver quatech2_device = {
1922 .name = "quatech_usb2", 1915 .name = "quatech_usb2",
1923 }, 1916 },
1924 .description = DRIVER_DESC, 1917 .description = DRIVER_DESC,
1925 .id_table = quausb2_id_table, 1918 .id_table = id_table,
1926 .num_ports = 8, 1919 .num_ports = 8,
1927 .open = qt2_open, 1920 .open = qt2_open,
1928 .close = qt2_close, 1921 .close = qt2_close,
@@ -1947,7 +1940,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
1947 &quatech2_device, NULL 1940 &quatech2_device, NULL
1948}; 1941};
1949 1942
1950module_usb_serial_driver(quausb2_usb_driver, serial_drivers); 1943module_usb_serial_driver(serial_drivers, id_table);
1951 1944
1952MODULE_AUTHOR(DRIVER_AUTHOR); 1945MODULE_AUTHOR(DRIVER_AUTHOR);
1953MODULE_DESCRIPTION(DRIVER_DESC); 1946MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c b/drivers/staging/serqt_usb2/serqt_usb2.c
index 1ffdaefa79be..f2ae004da5e5 100644
--- a/drivers/staging/serqt_usb2/serqt_usb2.c
+++ b/drivers/staging/serqt_usb2/serqt_usb2.c
@@ -125,7 +125,7 @@ static bool debug;
125#define MODEM_CTRL 0x40 125#define MODEM_CTRL 0x40
126#define RS232_MODE 0x00 126#define RS232_MODE 0x00
127 127
128static const struct usb_device_id serqt_id_table[] = { 128static const struct usb_device_id id_table[] = {
129 {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_SSU200)}, 129 {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_SSU200)},
130 {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_DSU100)}, 130 {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_DSU100)},
131 {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_DSU200)}, 131 {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_DSU200)},
@@ -152,8 +152,7 @@ static const struct usb_device_id serqt_id_table[] = {
152 {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_ESU100_2)}, 152 {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_ESU100_2)},
153 {} /* Terminating entry */ 153 {} /* Terminating entry */
154}; 154};
155 155MODULE_DEVICE_TABLE(usb, id_table);
156MODULE_DEVICE_TABLE(usb, serqt_id_table);
157 156
158struct qt_get_device_data { 157struct qt_get_device_data {
159 __u8 porta; 158 __u8 porta;
@@ -195,11 +194,6 @@ struct quatech_port {
195 char closePending; 194 char closePending;
196}; 195};
197 196
198static struct usb_driver serqt_usb_driver = {
199 .name = "quatech-usb-serial",
200 .id_table = serqt_id_table,
201};
202
203static int port_paranoia_check(struct usb_serial_port *port, 197static int port_paranoia_check(struct usb_serial_port *port,
204 const char *function) 198 const char *function)
205{ 199{
@@ -1544,7 +1538,7 @@ static struct usb_serial_driver quatech_device = {
1544 .name = "serqt", 1538 .name = "serqt",
1545 }, 1539 },
1546 .description = DRIVER_DESC, 1540 .description = DRIVER_DESC,
1547 .id_table = serqt_id_table, 1541 .id_table = id_table,
1548 .num_ports = 8, 1542 .num_ports = 8,
1549 .open = qt_open, 1543 .open = qt_open,
1550 .close = qt_close, 1544 .close = qt_close,
@@ -1567,7 +1561,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
1567 &quatech_device, NULL 1561 &quatech_device, NULL
1568}; 1562};
1569 1563
1570module_usb_serial_driver(serqt_usb_driver, serial_drivers); 1564module_usb_serial_driver(serial_drivers, id_table);
1571 1565
1572MODULE_AUTHOR(DRIVER_AUTHOR); 1566MODULE_AUTHOR(DRIVER_AUTHOR);
1573MODULE_DESCRIPTION(DRIVER_DESC); 1567MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/aircable.c b/drivers/usb/serial/aircable.c
index 93aabd292b48..cef5d75151dd 100644
--- a/drivers/usb/serial/aircable.c
+++ b/drivers/usb/serial/aircable.c
@@ -170,11 +170,6 @@ static void aircable_process_read_urb(struct urb *urb)
170 tty_kref_put(tty); 170 tty_kref_put(tty);
171} 171}
172 172
173static struct usb_driver aircable_driver = {
174 .name = "aircable",
175 .id_table = id_table,
176};
177
178static struct usb_serial_driver aircable_device = { 173static struct usb_serial_driver aircable_device = {
179 .driver = { 174 .driver = {
180 .owner = THIS_MODULE, 175 .owner = THIS_MODULE,
@@ -194,7 +189,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
194 &aircable_device, NULL 189 &aircable_device, NULL
195}; 190};
196 191
197module_usb_serial_driver(aircable_driver, serial_drivers); 192module_usb_serial_driver(serial_drivers, id_table);
198 193
199MODULE_AUTHOR(DRIVER_AUTHOR); 194MODULE_AUTHOR(DRIVER_AUTHOR);
200MODULE_DESCRIPTION(DRIVER_DESC); 195MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
index 4b79679183ba..9413b7491d43 100644
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -714,11 +714,6 @@ static void ark3116_process_read_urb(struct urb *urb)
714 tty_kref_put(tty); 714 tty_kref_put(tty);
715} 715}
716 716
717static struct usb_driver ark3116_driver = {
718 .name = "ark3116",
719 .id_table = id_table,
720};
721
722static struct usb_serial_driver ark3116_device = { 717static struct usb_serial_driver ark3116_device = {
723 .driver = { 718 .driver = {
724 .owner = THIS_MODULE, 719 .owner = THIS_MODULE,
@@ -745,7 +740,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
745 &ark3116_device, NULL 740 &ark3116_device, NULL
746}; 741};
747 742
748module_usb_serial_driver(ark3116_driver, serial_drivers); 743module_usb_serial_driver(serial_drivers, id_table);
749 744
750MODULE_LICENSE("GPL"); 745MODULE_LICENSE("GPL");
751 746
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
index 13031bb1e2cb..5965df72cd07 100644
--- a/drivers/usb/serial/belkin_sa.c
+++ b/drivers/usb/serial/belkin_sa.c
@@ -62,7 +62,7 @@ static int belkin_sa_tiocmset(struct tty_struct *tty,
62 unsigned int set, unsigned int clear); 62 unsigned int set, unsigned int clear);
63 63
64 64
65static const struct usb_device_id id_table_combined[] = { 65static const struct usb_device_id id_table[] = {
66 { USB_DEVICE(BELKIN_SA_VID, BELKIN_SA_PID) }, 66 { USB_DEVICE(BELKIN_SA_VID, BELKIN_SA_PID) },
67 { USB_DEVICE(BELKIN_OLD_VID, BELKIN_OLD_PID) }, 67 { USB_DEVICE(BELKIN_OLD_VID, BELKIN_OLD_PID) },
68 { USB_DEVICE(PERACOM_VID, PERACOM_PID) }, 68 { USB_DEVICE(PERACOM_VID, PERACOM_PID) },
@@ -71,12 +71,7 @@ static const struct usb_device_id id_table_combined[] = {
71 { USB_DEVICE(BELKIN_DOCKSTATION_VID, BELKIN_DOCKSTATION_PID) }, 71 { USB_DEVICE(BELKIN_DOCKSTATION_VID, BELKIN_DOCKSTATION_PID) },
72 { } /* Terminating entry */ 72 { } /* Terminating entry */
73}; 73};
74MODULE_DEVICE_TABLE(usb, id_table_combined); 74MODULE_DEVICE_TABLE(usb, id_table);
75
76static struct usb_driver belkin_driver = {
77 .name = "belkin",
78 .id_table = id_table_combined,
79};
80 75
81/* All of the device info needed for the serial converters */ 76/* All of the device info needed for the serial converters */
82static struct usb_serial_driver belkin_device = { 77static struct usb_serial_driver belkin_device = {
@@ -85,7 +80,7 @@ static struct usb_serial_driver belkin_device = {
85 .name = "belkin", 80 .name = "belkin",
86 }, 81 },
87 .description = "Belkin / Peracom / GoHubs USB Serial Adapter", 82 .description = "Belkin / Peracom / GoHubs USB Serial Adapter",
88 .id_table = id_table_combined, 83 .id_table = id_table,
89 .num_ports = 1, 84 .num_ports = 1,
90 .open = belkin_sa_open, 85 .open = belkin_sa_open,
91 .close = belkin_sa_close, 86 .close = belkin_sa_close,
@@ -513,7 +508,7 @@ exit:
513 return retval; 508 return retval;
514} 509}
515 510
516module_usb_serial_driver(belkin_driver, serial_drivers); 511module_usb_serial_driver(serial_drivers, id_table);
517 512
518MODULE_AUTHOR(DRIVER_AUTHOR); 513MODULE_AUTHOR(DRIVER_AUTHOR);
519MODULE_DESCRIPTION(DRIVER_DESC); 514MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index 95b259747697..a2b7ea726bfb 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -589,11 +589,6 @@ static int ch341_resume(struct usb_serial *serial)
589 return 0; 589 return 0;
590} 590}
591 591
592static struct usb_driver ch341_driver = {
593 .name = "ch341",
594 .id_table = id_table,
595};
596
597static struct usb_serial_driver ch341_device = { 592static struct usb_serial_driver ch341_device = {
598 .driver = { 593 .driver = {
599 .owner = THIS_MODULE, 594 .owner = THIS_MODULE,
@@ -619,7 +614,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
619 &ch341_device, NULL 614 &ch341_device, NULL
620}; 615};
621 616
622module_usb_serial_driver(ch341_driver, serial_drivers); 617module_usb_serial_driver(serial_drivers, id_table);
623 618
624MODULE_LICENSE("GPL"); 619MODULE_LICENSE("GPL");
625 620
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 02a1cab92485..1b1926200ba7 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -156,11 +156,6 @@ struct cp210x_port_private {
156 __u8 bInterfaceNumber; 156 __u8 bInterfaceNumber;
157}; 157};
158 158
159static struct usb_driver cp210x_driver = {
160 .name = "cp210x",
161 .id_table = id_table,
162};
163
164static struct usb_serial_driver cp210x_device = { 159static struct usb_serial_driver cp210x_device = {
165 .driver = { 160 .driver = {
166 .owner = THIS_MODULE, 161 .owner = THIS_MODULE,
@@ -880,7 +875,7 @@ static void cp210x_release(struct usb_serial *serial)
880 } 875 }
881} 876}
882 877
883module_usb_serial_driver(cp210x_driver, serial_drivers); 878module_usb_serial_driver(serial_drivers, id_table);
884 879
885MODULE_DESCRIPTION(DRIVER_DESC); 880MODULE_DESCRIPTION(DRIVER_DESC);
886MODULE_VERSION(DRIVER_VERSION); 881MODULE_VERSION(DRIVER_VERSION);
diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
index 37fb911c1cc0..3aa0b530f68e 100644
--- a/drivers/usb/serial/cyberjack.c
+++ b/drivers/usb/serial/cyberjack.c
@@ -77,11 +77,6 @@ static const struct usb_device_id id_table[] = {
77 77
78MODULE_DEVICE_TABLE(usb, id_table); 78MODULE_DEVICE_TABLE(usb, id_table);
79 79
80static struct usb_driver cyberjack_driver = {
81 .name = "cyberjack",
82 .id_table = id_table,
83};
84
85static struct usb_serial_driver cyberjack_device = { 80static struct usb_serial_driver cyberjack_device = {
86 .driver = { 81 .driver = {
87 .owner = THIS_MODULE, 82 .owner = THIS_MODULE,
@@ -455,7 +450,7 @@ exit:
455 usb_serial_port_softint(port); 450 usb_serial_port_softint(port);
456} 451}
457 452
458module_usb_serial_driver(cyberjack_driver, serial_drivers); 453module_usb_serial_driver(serial_drivers, id_table);
459 454
460MODULE_AUTHOR(DRIVER_AUTHOR); 455MODULE_AUTHOR(DRIVER_AUTHOR);
461MODULE_DESCRIPTION(DRIVER_DESC); 456MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index df53d57edb3f..b78c34eb5d3f 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -89,11 +89,6 @@ static const struct usb_device_id id_table_combined[] = {
89 89
90MODULE_DEVICE_TABLE(usb, id_table_combined); 90MODULE_DEVICE_TABLE(usb, id_table_combined);
91 91
92static struct usb_driver cypress_driver = {
93 .name = "cypress",
94 .id_table = id_table_combined,
95};
96
97enum packet_format { 92enum packet_format {
98 packet_format_1, /* b0:status, b1:payload count */ 93 packet_format_1, /* b0:status, b1:payload count */
99 packet_format_2 /* b0[7:3]:status, b0[2:0]:payload count */ 94 packet_format_2 /* b0[7:3]:status, b0[2:0]:payload count */
@@ -1308,7 +1303,7 @@ static void cypress_write_int_callback(struct urb *urb)
1308 cypress_send(port); 1303 cypress_send(port);
1309} 1304}
1310 1305
1311module_usb_serial_driver(cypress_driver, serial_drivers); 1306module_usb_serial_driver(serial_drivers, id_table_combined);
1312 1307
1313MODULE_AUTHOR(DRIVER_AUTHOR); 1308MODULE_AUTHOR(DRIVER_AUTHOR);
1314MODULE_DESCRIPTION(DRIVER_DESC); 1309MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index 3b584db1599f..b5cd838093ef 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -271,12 +271,6 @@ static const struct usb_device_id id_table_4[] = {
271 271
272MODULE_DEVICE_TABLE(usb, id_table_combined); 272MODULE_DEVICE_TABLE(usb, id_table_combined);
273 273
274static struct usb_driver digi_driver = {
275 .name = "digi_acceleport",
276 .id_table = id_table_combined,
277};
278
279
280/* device info needed for the Digi serial converter */ 274/* device info needed for the Digi serial converter */
281 275
282static struct usb_serial_driver digi_acceleport_2_device = { 276static struct usb_serial_driver digi_acceleport_2_device = {
@@ -1553,7 +1547,7 @@ static int digi_read_oob_callback(struct urb *urb)
1553 1547
1554} 1548}
1555 1549
1556module_usb_serial_driver(digi_driver, serial_drivers); 1550module_usb_serial_driver(serial_drivers, id_table_combined);
1557 1551
1558MODULE_AUTHOR(DRIVER_AUTHOR); 1552MODULE_AUTHOR(DRIVER_AUTHOR);
1559MODULE_DESCRIPTION(DRIVER_DESC); 1553MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c
index 80447e5a6926..cdf61dd07318 100644
--- a/drivers/usb/serial/empeg.c
+++ b/drivers/usb/serial/empeg.c
@@ -51,11 +51,6 @@ static const struct usb_device_id id_table[] = {
51 51
52MODULE_DEVICE_TABLE(usb, id_table); 52MODULE_DEVICE_TABLE(usb, id_table);
53 53
54static struct usb_driver empeg_driver = {
55 .name = "empeg",
56 .id_table = id_table,
57};
58
59static struct usb_serial_driver empeg_device = { 54static struct usb_serial_driver empeg_device = {
60 .driver = { 55 .driver = {
61 .owner = THIS_MODULE, 56 .owner = THIS_MODULE,
@@ -134,7 +129,7 @@ static void empeg_init_termios(struct tty_struct *tty)
134 tty_encode_baud_rate(tty, 115200, 115200); 129 tty_encode_baud_rate(tty, 115200, 115200);
135} 130}
136 131
137module_usb_serial_driver(empeg_driver, serial_drivers); 132module_usb_serial_driver(serial_drivers, id_table);
138 133
139MODULE_AUTHOR(DRIVER_AUTHOR); 134MODULE_AUTHOR(DRIVER_AUTHOR);
140MODULE_DESCRIPTION(DRIVER_DESC); 135MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c
index 9052ec3cdf70..5a247ff81908 100644
--- a/drivers/usb/serial/f81232.c
+++ b/drivers/usb/serial/f81232.c
@@ -350,18 +350,12 @@ static void f81232_release(struct usb_serial *serial)
350 } 350 }
351} 351}
352 352
353static struct usb_driver f81232_driver = {
354 .name = "f81232",
355 .id_table = id_table,
356};
357
358static struct usb_serial_driver f81232_device = { 353static struct usb_serial_driver f81232_device = {
359 .driver = { 354 .driver = {
360 .owner = THIS_MODULE, 355 .owner = THIS_MODULE,
361 .name = "f81232", 356 .name = "f81232",
362 }, 357 },
363 .id_table = id_table, 358 .id_table = id_table,
364 .usb_driver = &f81232_driver,
365 .num_ports = 1, 359 .num_ports = 1,
366 .bulk_in_size = 256, 360 .bulk_in_size = 256,
367 .bulk_out_size = 256, 361 .bulk_out_size = 256,
@@ -385,7 +379,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
385 NULL, 379 NULL,
386}; 380};
387 381
388module_usb_serial_driver(f81232_driver, serial_drivers); 382module_usb_serial_driver(serial_drivers, id_table);
389 383
390MODULE_DESCRIPTION("Fintek F81232 USB to serial adaptor driver"); 384MODULE_DESCRIPTION("Fintek F81232 USB to serial adaptor driver");
391MODULE_AUTHOR("Greg Kroah-Hartman <gregkh@linuxfoundation.org"); 385MODULE_AUTHOR("Greg Kroah-Hartman <gregkh@linuxfoundation.org");
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index e0e2b94e7833..8c084ea34e26 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -862,11 +862,6 @@ static struct usb_device_id id_table_combined [] = {
862 862
863MODULE_DEVICE_TABLE(usb, id_table_combined); 863MODULE_DEVICE_TABLE(usb, id_table_combined);
864 864
865static struct usb_driver ftdi_driver = {
866 .name = "ftdi_sio",
867 .id_table = id_table_combined,
868};
869
870static const char *ftdi_chip_name[] = { 865static const char *ftdi_chip_name[] = {
871 [SIO] = "SIO", /* the serial part of FT8U100AX */ 866 [SIO] = "SIO", /* the serial part of FT8U100AX */
872 [FT8U232AM] = "FT8U232AM", 867 [FT8U232AM] = "FT8U232AM",
@@ -2413,7 +2408,7 @@ static int __init ftdi_init(void)
2413 id_table_combined[i].idVendor = vendor; 2408 id_table_combined[i].idVendor = vendor;
2414 id_table_combined[i].idProduct = product; 2409 id_table_combined[i].idProduct = product;
2415 } 2410 }
2416 retval = usb_serial_register_drivers(&ftdi_driver, serial_drivers); 2411 retval = usb_serial_register_drivers(serial_drivers, KBUILD_MODNAME, id_table_combined);
2417 if (retval == 0) 2412 if (retval == 0)
2418 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" 2413 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
2419 DRIVER_DESC "\n"); 2414 DRIVER_DESC "\n");
@@ -2422,7 +2417,7 @@ static int __init ftdi_init(void)
2422 2417
2423static void __exit ftdi_exit(void) 2418static void __exit ftdi_exit(void)
2424{ 2419{
2425 usb_serial_deregister_drivers(&ftdi_driver, serial_drivers); 2420 usb_serial_deregister_drivers(serial_drivers);
2426} 2421}
2427 2422
2428 2423
diff --git a/drivers/usb/serial/funsoft.c b/drivers/usb/serial/funsoft.c
index 2049911ae759..235707961ca3 100644
--- a/drivers/usb/serial/funsoft.c
+++ b/drivers/usb/serial/funsoft.c
@@ -24,11 +24,6 @@ static const struct usb_device_id id_table[] = {
24}; 24};
25MODULE_DEVICE_TABLE(usb, id_table); 25MODULE_DEVICE_TABLE(usb, id_table);
26 26
27static struct usb_driver funsoft_driver = {
28 .name = "funsoft",
29 .id_table = id_table,
30};
31
32static struct usb_serial_driver funsoft_device = { 27static struct usb_serial_driver funsoft_device = {
33 .driver = { 28 .driver = {
34 .owner = THIS_MODULE, 29 .owner = THIS_MODULE,
@@ -42,7 +37,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
42 &funsoft_device, NULL 37 &funsoft_device, NULL
43}; 38};
44 39
45module_usb_serial_driver(funsoft_driver, serial_drivers); 40module_usb_serial_driver(serial_drivers, id_table);
46 41
47MODULE_LICENSE("GPL"); 42MODULE_LICENSE("GPL");
48 43
diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c
index 0e595a6521ec..346c15a51066 100644
--- a/drivers/usb/serial/garmin_gps.c
+++ b/drivers/usb/serial/garmin_gps.c
@@ -216,14 +216,8 @@ static const struct usb_device_id id_table[] = {
216 { USB_DEVICE(GARMIN_VENDOR_ID, 3) }, 216 { USB_DEVICE(GARMIN_VENDOR_ID, 3) },
217 { } /* Terminating entry */ 217 { } /* Terminating entry */
218}; 218};
219
220MODULE_DEVICE_TABLE(usb, id_table); 219MODULE_DEVICE_TABLE(usb, id_table);
221 220
222static struct usb_driver garmin_driver = {
223 .name = "garmin_gps",
224 .id_table = id_table,
225};
226
227 221
228static inline int getLayerId(const __u8 *usbPacket) 222static inline int getLayerId(const __u8 *usbPacket)
229{ 223{
@@ -1495,7 +1489,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
1495 &garmin_device, NULL 1489 &garmin_device, NULL
1496}; 1490};
1497 1491
1498module_usb_serial_driver(garmin_driver, serial_drivers); 1492module_usb_serial_driver(serial_drivers, id_table);
1499 1493
1500MODULE_AUTHOR(DRIVER_AUTHOR); 1494MODULE_AUTHOR(DRIVER_AUTHOR);
1501MODULE_DESCRIPTION(DRIVER_DESC); 1495MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 4e5e993771e9..3644f513a4e0 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -46,11 +46,6 @@ static const struct usb_device_id generic_serial_ids[] = {
46 {} 46 {}
47}; 47};
48 48
49static struct usb_driver generic_driver = {
50 .name = "usbserial_generic",
51 .id_table = generic_serial_ids,
52};
53
54/* All of the device info needed for the Generic Serial Converter */ 49/* All of the device info needed for the Generic Serial Converter */
55struct usb_serial_driver usb_serial_generic_device = { 50struct usb_serial_driver usb_serial_generic_device = {
56 .driver = { 51 .driver = {
@@ -84,7 +79,7 @@ int usb_serial_generic_register(int _debug)
84 USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT; 79 USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT;
85 80
86 /* register our generic driver with ourselves */ 81 /* register our generic driver with ourselves */
87 retval = usb_serial_register_drivers(&generic_driver, serial_drivers); 82 retval = usb_serial_register_drivers(serial_drivers, "usbserial_generic", generic_serial_ids);
88#endif 83#endif
89 return retval; 84 return retval;
90} 85}
@@ -93,7 +88,7 @@ void usb_serial_generic_deregister(void)
93{ 88{
94#ifdef CONFIG_USB_SERIAL_GENERIC 89#ifdef CONFIG_USB_SERIAL_GENERIC
95 /* remove our generic driver */ 90 /* remove our generic driver */
96 usb_serial_deregister_drivers(&generic_driver, serial_drivers); 91 usb_serial_deregister_drivers(serial_drivers);
97#endif 92#endif
98} 93}
99 94
diff --git a/drivers/usb/serial/hp4x.c b/drivers/usb/serial/hp4x.c
index 37fe402ba830..0bbaf21a9d1e 100644
--- a/drivers/usb/serial/hp4x.c
+++ b/drivers/usb/serial/hp4x.c
@@ -36,11 +36,6 @@ static const struct usb_device_id id_table[] = {
36 36
37MODULE_DEVICE_TABLE(usb, id_table); 37MODULE_DEVICE_TABLE(usb, id_table);
38 38
39static struct usb_driver hp49gp_driver = {
40 .name = "hp4X",
41 .id_table = id_table,
42};
43
44static struct usb_serial_driver hp49gp_device = { 39static struct usb_serial_driver hp49gp_device = {
45 .driver = { 40 .driver = {
46 .owner = THIS_MODULE, 41 .owner = THIS_MODULE,
@@ -54,7 +49,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
54 &hp49gp_device, NULL 49 &hp49gp_device, NULL
55}; 50};
56 51
57module_usb_serial_driver(hp49gp_driver, serial_drivers); 52module_usb_serial_driver(serial_drivers, id_table);
58 53
59MODULE_DESCRIPTION(DRIVER_DESC); 54MODULE_DESCRIPTION(DRIVER_DESC);
60MODULE_VERSION(DRIVER_VERSION); 55MODULE_VERSION(DRIVER_VERSION);
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index 323e87235711..e1f5ccd1e8f8 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -3181,7 +3181,7 @@ static void edge_release(struct usb_serial *serial)
3181 kfree(edge_serial); 3181 kfree(edge_serial);
3182} 3182}
3183 3183
3184module_usb_serial_driver(io_driver, serial_drivers); 3184module_usb_serial_driver(serial_drivers, id_table_combined);
3185 3185
3186MODULE_AUTHOR(DRIVER_AUTHOR); 3186MODULE_AUTHOR(DRIVER_AUTHOR);
3187MODULE_DESCRIPTION(DRIVER_DESC); 3187MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/io_tables.h b/drivers/usb/serial/io_tables.h
index 650693b1e18b..350afddb55ba 100644
--- a/drivers/usb/serial/io_tables.h
+++ b/drivers/usb/serial/io_tables.h
@@ -95,11 +95,6 @@ static const struct usb_device_id id_table_combined[] = {
95 95
96MODULE_DEVICE_TABLE(usb, id_table_combined); 96MODULE_DEVICE_TABLE(usb, id_table_combined);
97 97
98static struct usb_driver io_driver = {
99 .name = "io_edgeport",
100 .id_table = id_table_combined,
101};
102
103static struct usb_serial_driver edgeport_2port_device = { 98static struct usb_serial_driver edgeport_2port_device = {
104 .driver = { 99 .driver = {
105 .owner = THIS_MODULE, 100 .owner = THIS_MODULE,
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 643c12014312..3936904c6419 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -197,12 +197,6 @@ static const struct usb_device_id id_table_combined[] = {
197 197
198MODULE_DEVICE_TABLE(usb, id_table_combined); 198MODULE_DEVICE_TABLE(usb, id_table_combined);
199 199
200static struct usb_driver io_driver = {
201 .name = "io_ti",
202 .id_table = id_table_combined,
203};
204
205
206static unsigned char OperationalMajorVersion; 200static unsigned char OperationalMajorVersion;
207static unsigned char OperationalMinorVersion; 201static unsigned char OperationalMinorVersion;
208static unsigned short OperationalBuildNumber; 202static unsigned short OperationalBuildNumber;
@@ -2788,7 +2782,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
2788 &edgeport_1port_device, &edgeport_2port_device, NULL 2782 &edgeport_1port_device, &edgeport_2port_device, NULL
2789}; 2783};
2790 2784
2791module_usb_serial_driver(io_driver, serial_drivers); 2785module_usb_serial_driver(serial_drivers, id_table_combined);
2792 2786
2793MODULE_AUTHOR(DRIVER_AUTHOR); 2787MODULE_AUTHOR(DRIVER_AUTHOR);
2794MODULE_DESCRIPTION(DRIVER_DESC); 2788MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index 7d1ae700c29d..bf440b12523c 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -502,11 +502,6 @@ static struct usb_device_id ipaq_id_table [] = {
502 502
503MODULE_DEVICE_TABLE(usb, ipaq_id_table); 503MODULE_DEVICE_TABLE(usb, ipaq_id_table);
504 504
505static struct usb_driver ipaq_driver = {
506 .name = "ipaq",
507 .id_table = ipaq_id_table,
508};
509
510 505
511/* All of the device info needed for the Compaq iPAQ */ 506/* All of the device info needed for the Compaq iPAQ */
512static struct usb_serial_driver ipaq_device = { 507static struct usb_serial_driver ipaq_device = {
@@ -614,7 +609,7 @@ static int ipaq_startup(struct usb_serial *serial)
614 return usb_reset_configuration(serial->dev); 609 return usb_reset_configuration(serial->dev);
615} 610}
616 611
617module_usb_serial_driver(ipaq_driver, serial_drivers); 612module_usb_serial_driver(serial_drivers, ipaq_id_table);
618 613
619MODULE_AUTHOR(DRIVER_AUTHOR); 614MODULE_AUTHOR(DRIVER_AUTHOR);
620MODULE_DESCRIPTION(DRIVER_DESC); 615MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c
index 76901336cfeb..5811d34b6c6b 100644
--- a/drivers/usb/serial/ipw.c
+++ b/drivers/usb/serial/ipw.c
@@ -132,17 +132,11 @@ enum {
132 132
133#define IPW_WANTS_TO_SEND 0x30 133#define IPW_WANTS_TO_SEND 0x30
134 134
135static const struct usb_device_id usb_ipw_ids[] = { 135static const struct usb_device_id id_table[] = {
136 { USB_DEVICE(IPW_VID, IPW_PID) }, 136 { USB_DEVICE(IPW_VID, IPW_PID) },
137 { }, 137 { },
138}; 138};
139 139MODULE_DEVICE_TABLE(usb, id_table);
140MODULE_DEVICE_TABLE(usb, usb_ipw_ids);
141
142static struct usb_driver usb_ipw_driver = {
143 .name = "ipwtty",
144 .id_table = usb_ipw_ids,
145};
146 140
147static bool debug; 141static bool debug;
148 142
@@ -313,7 +307,7 @@ static struct usb_serial_driver ipw_device = {
313 .name = "ipw", 307 .name = "ipw",
314 }, 308 },
315 .description = "IPWireless converter", 309 .description = "IPWireless converter",
316 .id_table = usb_ipw_ids, 310 .id_table = id_table,
317 .num_ports = 1, 311 .num_ports = 1,
318 .disconnect = usb_wwan_disconnect, 312 .disconnect = usb_wwan_disconnect,
319 .open = ipw_open, 313 .open = ipw_open,
@@ -329,7 +323,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
329 &ipw_device, NULL 323 &ipw_device, NULL
330}; 324};
331 325
332module_usb_serial_driver(usb_ipw_driver, serial_drivers); 326module_usb_serial_driver(serial_drivers, id_table);
333 327
334/* Module information */ 328/* Module information */
335MODULE_AUTHOR(DRIVER_AUTHOR); 329MODULE_AUTHOR(DRIVER_AUTHOR);
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
index c69a81ec2fd6..e9f8e1916f07 100644
--- a/drivers/usb/serial/ir-usb.c
+++ b/drivers/usb/serial/ir-usb.c
@@ -77,11 +77,6 @@ static const struct usb_device_id ir_id_table[] = {
77 77
78MODULE_DEVICE_TABLE(usb, ir_id_table); 78MODULE_DEVICE_TABLE(usb, ir_id_table);
79 79
80static struct usb_driver ir_driver = {
81 .name = "ir-usb",
82 .id_table = ir_id_table,
83};
84
85static struct usb_serial_driver ir_device = { 80static struct usb_serial_driver ir_device = {
86 .driver = { 81 .driver = {
87 .owner = THIS_MODULE, 82 .owner = THIS_MODULE,
@@ -436,7 +431,7 @@ static int __init ir_init(void)
436 ir_device.bulk_out_size = buffer_size; 431 ir_device.bulk_out_size = buffer_size;
437 } 432 }
438 433
439 retval = usb_serial_register_drivers(&ir_driver, serial_drivers); 434 retval = usb_serial_register_drivers(serial_drivers, KBUILD_MODNAME, ir_id_table);
440 if (retval == 0) 435 if (retval == 0)
441 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" 436 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
442 DRIVER_DESC "\n"); 437 DRIVER_DESC "\n");
@@ -445,7 +440,7 @@ static int __init ir_init(void)
445 440
446static void __exit ir_exit(void) 441static void __exit ir_exit(void)
447{ 442{
448 usb_serial_deregister_drivers(&ir_driver, serial_drivers); 443 usb_serial_deregister_drivers(serial_drivers);
449} 444}
450 445
451 446
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c
index 500e8fbdd9e5..22b1eb5040b7 100644
--- a/drivers/usb/serial/iuu_phoenix.c
+++ b/drivers/usb/serial/iuu_phoenix.c
@@ -51,11 +51,6 @@ static const struct usb_device_id id_table[] = {
51}; 51};
52MODULE_DEVICE_TABLE(usb, id_table); 52MODULE_DEVICE_TABLE(usb, id_table);
53 53
54static struct usb_driver iuu_driver = {
55 .name = "iuu_phoenix",
56 .id_table = id_table,
57};
58
59/* turbo parameter */ 54/* turbo parameter */
60static int boost = 100; 55static int boost = 100;
61static int clockmode = 1; 56static int clockmode = 1;
@@ -1254,7 +1249,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
1254 &iuu_device, NULL 1249 &iuu_device, NULL
1255}; 1250};
1256 1251
1257module_usb_serial_driver(iuu_driver, serial_drivers); 1252module_usb_serial_driver(serial_drivers, id_table);
1258 1253
1259MODULE_AUTHOR("Alain Degreffe eczema@ecze.com"); 1254MODULE_AUTHOR("Alain Degreffe eczema@ecze.com");
1260 1255
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index ec46053ad15f..a1b99243dac9 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -130,7 +130,7 @@ struct keyspan_port_private {
130#include "keyspan_usa67msg.h" 130#include "keyspan_usa67msg.h"
131 131
132 132
133module_usb_serial_driver(keyspan_driver, serial_drivers); 133module_usb_serial_driver(serial_drivers, keyspan_ids_combined);
134 134
135static void keyspan_break_ctl(struct tty_struct *tty, int break_state) 135static void keyspan_break_ctl(struct tty_struct *tty, int break_state)
136{ 136{
diff --git a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h
index bb018dfaaa4a..fe1c5d91692c 100644
--- a/drivers/usb/serial/keyspan.h
+++ b/drivers/usb/serial/keyspan.h
@@ -487,11 +487,6 @@ static const struct usb_device_id keyspan_ids_combined[] = {
487 487
488MODULE_DEVICE_TABLE(usb, keyspan_ids_combined); 488MODULE_DEVICE_TABLE(usb, keyspan_ids_combined);
489 489
490static struct usb_driver keyspan_driver = {
491 .name = "keyspan",
492 .id_table = keyspan_ids_combined,
493};
494
495/* usb_device_id table for the pre-firmware download keyspan devices */ 490/* usb_device_id table for the pre-firmware download keyspan devices */
496static const struct usb_device_id keyspan_pre_ids[] = { 491static const struct usb_device_id keyspan_pre_ids[] = {
497 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_pre_product_id) }, 492 { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_pre_product_id) },
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
index 62574cf7e74c..a4ac3cfeffc4 100644
--- a/drivers/usb/serial/keyspan_pda.c
+++ b/drivers/usb/serial/keyspan_pda.c
@@ -86,11 +86,6 @@ static const struct usb_device_id id_table_combined[] = {
86 86
87MODULE_DEVICE_TABLE(usb, id_table_combined); 87MODULE_DEVICE_TABLE(usb, id_table_combined);
88 88
89static struct usb_driver keyspan_pda_driver = {
90 .name = "keyspan_pda",
91 .id_table = id_table_combined,
92};
93
94static const struct usb_device_id id_table_std[] = { 89static const struct usb_device_id id_table_std[] = {
95 { USB_DEVICE(KEYSPAN_VENDOR_ID, KEYSPAN_PDA_ID) }, 90 { USB_DEVICE(KEYSPAN_VENDOR_ID, KEYSPAN_PDA_ID) },
96 { } /* Terminating entry */ 91 { } /* Terminating entry */
@@ -828,7 +823,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
828 NULL 823 NULL
829}; 824};
830 825
831module_usb_serial_driver(keyspan_pda_driver, serial_drivers); 826module_usb_serial_driver(serial_drivers, id_table_combined);
832 827
833MODULE_AUTHOR(DRIVER_AUTHOR); 828MODULE_AUTHOR(DRIVER_AUTHOR);
834MODULE_DESCRIPTION(DRIVER_DESC); 829MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index 26dcfac6f6a8..5bed59cd5776 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -86,11 +86,6 @@ static const struct usb_device_id id_table[] = {
86 86
87MODULE_DEVICE_TABLE(usb, id_table); 87MODULE_DEVICE_TABLE(usb, id_table);
88 88
89static struct usb_driver kl5kusb105d_driver = {
90 .name = "kl5kusb105d",
91 .id_table = id_table,
92};
93
94static struct usb_serial_driver kl5kusb105d_device = { 89static struct usb_serial_driver kl5kusb105d_device = {
95 .driver = { 90 .driver = {
96 .owner = THIS_MODULE, 91 .owner = THIS_MODULE,
@@ -681,7 +676,7 @@ static int klsi_105_tiocmset(struct tty_struct *tty,
681 return retval; 676 return retval;
682} 677}
683 678
684module_usb_serial_driver(kl5kusb105d_driver, serial_drivers); 679module_usb_serial_driver(serial_drivers, id_table);
685 680
686MODULE_AUTHOR(DRIVER_AUTHOR); 681MODULE_AUTHOR(DRIVER_AUTHOR);
687MODULE_DESCRIPTION(DRIVER_DESC); 682MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
index 68fb36a81b46..fafeabb64c55 100644
--- a/drivers/usb/serial/kobil_sct.c
+++ b/drivers/usb/serial/kobil_sct.c
@@ -81,16 +81,8 @@ static const struct usb_device_id id_table[] = {
81 { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_KAAN_SIM_PRODUCT_ID) }, 81 { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_KAAN_SIM_PRODUCT_ID) },
82 { } /* Terminating entry */ 82 { } /* Terminating entry */
83}; 83};
84
85
86MODULE_DEVICE_TABLE(usb, id_table); 84MODULE_DEVICE_TABLE(usb, id_table);
87 85
88static struct usb_driver kobil_driver = {
89 .name = "kobil",
90 .id_table = id_table,
91};
92
93
94static struct usb_serial_driver kobil_device = { 86static struct usb_serial_driver kobil_device = {
95 .driver = { 87 .driver = {
96 .owner = THIS_MODULE, 88 .owner = THIS_MODULE,
@@ -674,7 +666,7 @@ static int kobil_ioctl(struct tty_struct *tty,
674 } 666 }
675} 667}
676 668
677module_usb_serial_driver(kobil_driver, serial_drivers); 669module_usb_serial_driver(serial_drivers, id_table);
678 670
679MODULE_AUTHOR(DRIVER_AUTHOR); 671MODULE_AUTHOR(DRIVER_AUTHOR);
680MODULE_DESCRIPTION(DRIVER_DESC); 672MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
index a63d1e8be911..d0ec1aa52719 100644
--- a/drivers/usb/serial/mct_u232.c
+++ b/drivers/usb/serial/mct_u232.c
@@ -73,20 +73,14 @@ static void mct_u232_unthrottle(struct tty_struct *tty);
73/* 73/*
74 * All of the device info needed for the MCT USB-RS232 converter. 74 * All of the device info needed for the MCT USB-RS232 converter.
75 */ 75 */
76static const struct usb_device_id id_table_combined[] = { 76static const struct usb_device_id id_table[] = {
77 { USB_DEVICE(MCT_U232_VID, MCT_U232_PID) }, 77 { USB_DEVICE(MCT_U232_VID, MCT_U232_PID) },
78 { USB_DEVICE(MCT_U232_VID, MCT_U232_SITECOM_PID) }, 78 { USB_DEVICE(MCT_U232_VID, MCT_U232_SITECOM_PID) },
79 { USB_DEVICE(MCT_U232_VID, MCT_U232_DU_H3SP_PID) }, 79 { USB_DEVICE(MCT_U232_VID, MCT_U232_DU_H3SP_PID) },
80 { USB_DEVICE(MCT_U232_BELKIN_F5U109_VID, MCT_U232_BELKIN_F5U109_PID) }, 80 { USB_DEVICE(MCT_U232_BELKIN_F5U109_VID, MCT_U232_BELKIN_F5U109_PID) },
81 { } /* Terminating entry */ 81 { } /* Terminating entry */
82}; 82};
83 83MODULE_DEVICE_TABLE(usb, id_table);
84MODULE_DEVICE_TABLE(usb, id_table_combined);
85
86static struct usb_driver mct_u232_driver = {
87 .name = "mct_u232",
88 .id_table = id_table_combined,
89};
90 84
91static struct usb_serial_driver mct_u232_device = { 85static struct usb_serial_driver mct_u232_device = {
92 .driver = { 86 .driver = {
@@ -94,7 +88,7 @@ static struct usb_serial_driver mct_u232_device = {
94 .name = "mct_u232", 88 .name = "mct_u232",
95 }, 89 },
96 .description = "MCT U232", 90 .description = "MCT U232",
97 .id_table = id_table_combined, 91 .id_table = id_table,
98 .num_ports = 1, 92 .num_ports = 1,
99 .open = mct_u232_open, 93 .open = mct_u232_open,
100 .close = mct_u232_close, 94 .close = mct_u232_close,
@@ -887,7 +881,7 @@ static int mct_u232_get_icount(struct tty_struct *tty,
887 return 0; 881 return 0;
888} 882}
889 883
890module_usb_serial_driver(mct_u232_driver, serial_drivers); 884module_usb_serial_driver(serial_drivers, id_table);
891 885
892MODULE_AUTHOR(DRIVER_AUTHOR); 886MODULE_AUTHOR(DRIVER_AUTHOR);
893MODULE_DESCRIPTION(DRIVER_DESC); 887MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/metro-usb.c b/drivers/usb/serial/metro-usb.c
index 14ad1db38ab5..81423f7361db 100644
--- a/drivers/usb/serial/metro-usb.c
+++ b/drivers/usb/serial/metro-usb.c
@@ -419,11 +419,6 @@ static void metrousb_unthrottle(struct tty_struct *tty)
419 result); 419 result);
420} 420}
421 421
422static struct usb_driver metrousb_driver = {
423 .name = "metro-usb",
424 .id_table = id_table
425};
426
427static struct usb_serial_driver metrousb_device = { 422static struct usb_serial_driver metrousb_device = {
428 .driver = { 423 .driver = {
429 .owner = THIS_MODULE, 424 .owner = THIS_MODULE,
@@ -449,7 +444,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
449 NULL, 444 NULL,
450}; 445};
451 446
452module_usb_serial_driver(metrousb_driver, serial_drivers); 447module_usb_serial_driver(serial_drivers, id_table);
453 448
454MODULE_LICENSE("GPL"); 449MODULE_LICENSE("GPL");
455MODULE_AUTHOR("Philip Nicastro"); 450MODULE_AUTHOR("Philip Nicastro");
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index eef0d844ef76..a07dd3c8cfef 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -79,12 +79,12 @@ static struct usb_serial_driver moschip7720_2port_driver;
79#define MOSCHIP_DEVICE_ID_7720 0x7720 79#define MOSCHIP_DEVICE_ID_7720 0x7720
80#define MOSCHIP_DEVICE_ID_7715 0x7715 80#define MOSCHIP_DEVICE_ID_7715 0x7715
81 81
82static const struct usb_device_id moschip_port_id_table[] = { 82static const struct usb_device_id id_table[] = {
83 { USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7720) }, 83 { USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7720) },
84 { USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7715) }, 84 { USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7715) },
85 { } /* terminating entry */ 85 { } /* terminating entry */
86}; 86};
87MODULE_DEVICE_TABLE(usb, moschip_port_id_table); 87MODULE_DEVICE_TABLE(usb, id_table);
88 88
89#ifdef CONFIG_USB_SERIAL_MOS7715_PARPORT 89#ifdef CONFIG_USB_SERIAL_MOS7715_PARPORT
90 90
@@ -2158,18 +2158,13 @@ static void mos7720_release(struct usb_serial *serial)
2158 kfree(usb_get_serial_port_data(serial->port[i])); 2158 kfree(usb_get_serial_port_data(serial->port[i]));
2159} 2159}
2160 2160
2161static struct usb_driver usb_driver = {
2162 .name = "moschip7720",
2163 .id_table = moschip_port_id_table,
2164};
2165
2166static struct usb_serial_driver moschip7720_2port_driver = { 2161static struct usb_serial_driver moschip7720_2port_driver = {
2167 .driver = { 2162 .driver = {
2168 .owner = THIS_MODULE, 2163 .owner = THIS_MODULE,
2169 .name = "moschip7720", 2164 .name = "moschip7720",
2170 }, 2165 },
2171 .description = "Moschip 2 port adapter", 2166 .description = "Moschip 2 port adapter",
2172 .id_table = moschip_port_id_table, 2167 .id_table = id_table,
2173 .calc_num_ports = mos77xx_calc_num_ports, 2168 .calc_num_ports = mos77xx_calc_num_ports,
2174 .open = mos7720_open, 2169 .open = mos7720_open,
2175 .close = mos7720_close, 2170 .close = mos7720_close,
@@ -2195,7 +2190,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
2195 &moschip7720_2port_driver, NULL 2190 &moschip7720_2port_driver, NULL
2196}; 2191};
2197 2192
2198module_usb_serial_driver(usb_driver, serial_drivers); 2193module_usb_serial_driver(serial_drivers, id_table);
2199 2194
2200MODULE_AUTHOR(DRIVER_AUTHOR); 2195MODULE_AUTHOR(DRIVER_AUTHOR);
2201MODULE_DESCRIPTION(DRIVER_DESC); 2196MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 91c3c5eb74c5..29160f8b5101 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -117,8 +117,7 @@
117#define MOSCHIP_DEVICE_ID_7810 0x7810 117#define MOSCHIP_DEVICE_ID_7810 0x7810
118/* The native component can have its vendor/device id's overridden 118/* The native component can have its vendor/device id's overridden
119 * in vendor-specific implementations. Such devices can be handled 119 * in vendor-specific implementations. Such devices can be handled
120 * by making a change here, in moschip_port_id_table, and in 120 * by making a change here, in id_table.
121 * moschip_id_table_combined
122 */ 121 */
123#define USB_VENDOR_ID_BANDB 0x0856 122#define USB_VENDOR_ID_BANDB 0x0856
124#define BANDB_DEVICE_ID_USO9ML2_2 0xAC22 123#define BANDB_DEVICE_ID_USO9ML2_2 0xAC22
@@ -191,7 +190,7 @@
191 190
192static int device_type; 191static int device_type;
193 192
194static const struct usb_device_id moschip_port_id_table[] = { 193static const struct usb_device_id id_table[] __devinitconst = {
195 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, 194 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)},
196 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, 195 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)},
197 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7810)}, 196 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7810)},
@@ -212,30 +211,7 @@ static const struct usb_device_id moschip_port_id_table[] = {
212 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)}, 211 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)},
213 {} /* terminating entry */ 212 {} /* terminating entry */
214}; 213};
215 214MODULE_DEVICE_TABLE(usb, id_table);
216static const struct usb_device_id moschip_id_table_combined[] __devinitconst = {
217 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)},
218 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)},
219 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7810)},
220 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2)},
221 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2P)},
222 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4)},
223 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4P)},
224 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_2)},
225 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_4)},
226 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_2)},
227 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_4)},
228 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)},
229 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2P)},
230 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
231 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4P)},
232 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)},
233 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)},
234 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)},
235 {} /* terminating entry */
236};
237
238MODULE_DEVICE_TABLE(usb, moschip_id_table_combined);
239 215
240/* This structure holds all of the local port information */ 216/* This structure holds all of the local port information */
241 217
@@ -2783,18 +2759,13 @@ static void mos7840_release(struct usb_serial *serial)
2783 } 2759 }
2784} 2760}
2785 2761
2786static struct usb_driver io_driver = {
2787 .name = "mos7840",
2788 .id_table = moschip_id_table_combined,
2789};
2790
2791static struct usb_serial_driver moschip7840_4port_device = { 2762static struct usb_serial_driver moschip7840_4port_device = {
2792 .driver = { 2763 .driver = {
2793 .owner = THIS_MODULE, 2764 .owner = THIS_MODULE,
2794 .name = "mos7840", 2765 .name = "mos7840",
2795 }, 2766 },
2796 .description = DRIVER_DESC, 2767 .description = DRIVER_DESC,
2797 .id_table = moschip_port_id_table, 2768 .id_table = id_table,
2798 .num_ports = 4, 2769 .num_ports = 4,
2799 .open = mos7840_open, 2770 .open = mos7840_open,
2800 .close = mos7840_close, 2771 .close = mos7840_close,
@@ -2824,7 +2795,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
2824 &moschip7840_4port_device, NULL 2795 &moschip7840_4port_device, NULL
2825}; 2796};
2826 2797
2827module_usb_serial_driver(io_driver, serial_drivers); 2798module_usb_serial_driver(serial_drivers, id_table);
2828 2799
2829MODULE_DESCRIPTION(DRIVER_DESC); 2800MODULE_DESCRIPTION(DRIVER_DESC);
2830MODULE_LICENSE("GPL"); 2801MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/moto_modem.c b/drivers/usb/serial/moto_modem.c
index f6b055fb8eec..c5ff6c7795a6 100644
--- a/drivers/usb/serial/moto_modem.c
+++ b/drivers/usb/serial/moto_modem.c
@@ -31,11 +31,6 @@ static const struct usb_device_id id_table[] = {
31}; 31};
32MODULE_DEVICE_TABLE(usb, id_table); 32MODULE_DEVICE_TABLE(usb, id_table);
33 33
34static struct usb_driver moto_driver = {
35 .name = "moto-modem",
36 .id_table = id_table,
37};
38
39static struct usb_serial_driver moto_device = { 34static struct usb_serial_driver moto_device = {
40 .driver = { 35 .driver = {
41 .owner = THIS_MODULE, 36 .owner = THIS_MODULE,
@@ -49,5 +44,5 @@ static struct usb_serial_driver * const serial_drivers[] = {
49 &moto_device, NULL 44 &moto_device, NULL
50}; 45};
51 46
52module_usb_serial_driver(moto_driver, serial_drivers); 47module_usb_serial_driver(serial_drivers, id_table);
53MODULE_LICENSE("GPL"); 48MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/navman.c b/drivers/usb/serial/navman.c
index 6f12bbc51fc9..7a09e8a07907 100644
--- a/drivers/usb/serial/navman.c
+++ b/drivers/usb/serial/navman.c
@@ -30,11 +30,6 @@ static const struct usb_device_id id_table[] = {
30}; 30};
31MODULE_DEVICE_TABLE(usb, id_table); 31MODULE_DEVICE_TABLE(usb, id_table);
32 32
33static struct usb_driver navman_driver = {
34 .name = "navman",
35 .id_table = id_table,
36};
37
38static void navman_read_int_callback(struct urb *urb) 33static void navman_read_int_callback(struct urb *urb)
39{ 34{
40 struct usb_serial_port *port = urb->context; 35 struct usb_serial_port *port = urb->context;
@@ -124,7 +119,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
124 &navman_device, NULL 119 &navman_device, NULL
125}; 120};
126 121
127module_usb_serial_driver(navman_driver, serial_drivers); 122module_usb_serial_driver(serial_drivers, id_table);
128 123
129MODULE_LICENSE("GPL"); 124MODULE_LICENSE("GPL");
130 125
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
index 72176f38d219..6f3d7051c7f4 100644
--- a/drivers/usb/serial/omninet.c
+++ b/drivers/usb/serial/omninet.c
@@ -54,15 +54,8 @@ static const struct usb_device_id id_table[] = {
54 { USB_DEVICE(ZYXEL_VENDOR_ID, BT_IGNITIONPRO_ID) }, 54 { USB_DEVICE(ZYXEL_VENDOR_ID, BT_IGNITIONPRO_ID) },
55 { } /* Terminating entry */ 55 { } /* Terminating entry */
56}; 56};
57
58MODULE_DEVICE_TABLE(usb, id_table); 57MODULE_DEVICE_TABLE(usb, id_table);
59 58
60static struct usb_driver omninet_driver = {
61 .name = "omninet",
62 .id_table = id_table,
63};
64
65
66static struct usb_serial_driver zyxel_omninet_device = { 59static struct usb_serial_driver zyxel_omninet_device = {
67 .driver = { 60 .driver = {
68 .owner = THIS_MODULE, 61 .owner = THIS_MODULE,
@@ -306,7 +299,7 @@ static void omninet_release(struct usb_serial *serial)
306 kfree(usb_get_serial_port_data(port)); 299 kfree(usb_get_serial_port_data(port));
307} 300}
308 301
309module_usb_serial_driver(omninet_driver, serial_drivers); 302module_usb_serial_driver(serial_drivers, id_table);
310 303
311MODULE_AUTHOR(DRIVER_AUTHOR); 304MODULE_AUTHOR(DRIVER_AUTHOR);
312MODULE_DESCRIPTION(DRIVER_DESC); 305MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
index fe12cac4462c..91f89044e08d 100644
--- a/drivers/usb/serial/opticon.c
+++ b/drivers/usb/serial/opticon.c
@@ -615,7 +615,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
615 &opticon_device, NULL 615 &opticon_device, NULL
616}; 616};
617 617
618module_usb_serial_driver(opticon_driver, serial_drivers); 618module_usb_serial_driver(serial_drivers, id_table);
619 619
620MODULE_DESCRIPTION(DRIVER_DESC); 620MODULE_DESCRIPTION(DRIVER_DESC);
621MODULE_LICENSE("GPL"); 621MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 780c27658b9c..1aae9028cd0b 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -1220,11 +1220,6 @@ static const struct usb_device_id option_ids[] = {
1220}; 1220};
1221MODULE_DEVICE_TABLE(usb, option_ids); 1221MODULE_DEVICE_TABLE(usb, option_ids);
1222 1222
1223static struct usb_driver option_driver = {
1224 .name = "option",
1225 .id_table = option_ids,
1226};
1227
1228/* The card has three separate interfaces, which the serial driver 1223/* The card has three separate interfaces, which the serial driver
1229 * recognizes separately, thus num_port=1. 1224 * recognizes separately, thus num_port=1.
1230 */ 1225 */
@@ -1293,7 +1288,7 @@ struct option_port_private {
1293 unsigned long tx_start_time[N_OUT_URB]; 1288 unsigned long tx_start_time[N_OUT_URB];
1294}; 1289};
1295 1290
1296module_usb_serial_driver(option_driver, serial_drivers); 1291module_usb_serial_driver(serial_drivers, option_ids);
1297 1292
1298static bool is_blacklisted(const u8 ifnum, enum option_blacklist_reason reason, 1293static bool is_blacklisted(const u8 ifnum, enum option_blacklist_reason reason,
1299 const struct option_blacklist_info *blacklist) 1294 const struct option_blacklist_info *blacklist)
diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c
index 9b195030cbaa..5976b65ab6ee 100644
--- a/drivers/usb/serial/oti6858.c
+++ b/drivers/usb/serial/oti6858.c
@@ -66,11 +66,6 @@ static const struct usb_device_id id_table[] = {
66 66
67MODULE_DEVICE_TABLE(usb, id_table); 67MODULE_DEVICE_TABLE(usb, id_table);
68 68
69static struct usb_driver oti6858_driver = {
70 .name = "oti6858",
71 .id_table = id_table,
72};
73
74static bool debug; 69static bool debug;
75 70
76/* requests */ 71/* requests */
@@ -921,7 +916,7 @@ static void oti6858_write_bulk_callback(struct urb *urb)
921 } 916 }
922} 917}
923 918
924module_usb_serial_driver(oti6858_driver, serial_drivers); 919module_usb_serial_driver(serial_drivers, id_table);
925 920
926MODULE_DESCRIPTION(OTI6858_DESCRIPTION); 921MODULE_DESCRIPTION(OTI6858_DESCRIPTION);
927MODULE_AUTHOR(OTI6858_AUTHOR); 922MODULE_AUTHOR(OTI6858_AUTHOR);
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 642136e39fa6..13b8dd6481f5 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -95,11 +95,6 @@ static const struct usb_device_id id_table[] = {
95 95
96MODULE_DEVICE_TABLE(usb, id_table); 96MODULE_DEVICE_TABLE(usb, id_table);
97 97
98static struct usb_driver pl2303_driver = {
99 .name = "pl2303",
100 .id_table = id_table,
101};
102
103#define SET_LINE_REQUEST_TYPE 0x21 98#define SET_LINE_REQUEST_TYPE 0x21
104#define SET_LINE_REQUEST 0x20 99#define SET_LINE_REQUEST 0x20
105 100
@@ -840,7 +835,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
840 &pl2303_device, NULL 835 &pl2303_device, NULL
841}; 836};
842 837
843module_usb_serial_driver(pl2303_driver, serial_drivers); 838module_usb_serial_driver(serial_drivers, id_table);
844 839
845MODULE_DESCRIPTION(DRIVER_DESC); 840MODULE_DESCRIPTION(DRIVER_DESC);
846MODULE_LICENSE("GPL"); 841MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/qcaux.c b/drivers/usb/serial/qcaux.c
index b0b41c11e147..a4edc7ee9c8a 100644
--- a/drivers/usb/serial/qcaux.c
+++ b/drivers/usb/serial/qcaux.c
@@ -77,11 +77,6 @@ static struct usb_device_id id_table[] = {
77}; 77};
78MODULE_DEVICE_TABLE(usb, id_table); 78MODULE_DEVICE_TABLE(usb, id_table);
79 79
80static struct usb_driver qcaux_driver = {
81 .name = "qcaux",
82 .id_table = id_table,
83};
84
85static struct usb_serial_driver qcaux_device = { 80static struct usb_serial_driver qcaux_device = {
86 .driver = { 81 .driver = {
87 .owner = THIS_MODULE, 82 .owner = THIS_MODULE,
@@ -95,5 +90,5 @@ static struct usb_serial_driver * const serial_drivers[] = {
95 &qcaux_device, NULL 90 &qcaux_device, NULL
96}; 91};
97 92
98module_usb_serial_driver(qcaux_driver, serial_drivers); 93module_usb_serial_driver(serial_drivers, id_table);
99MODULE_LICENSE("GPL"); 94MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
index 400a59e4b0ed..bc690ae814d0 100644
--- a/drivers/usb/serial/qcserial.c
+++ b/drivers/usb/serial/qcserial.c
@@ -112,11 +112,6 @@ static const struct usb_device_id id_table[] = {
112}; 112};
113MODULE_DEVICE_TABLE(usb, id_table); 113MODULE_DEVICE_TABLE(usb, id_table);
114 114
115static struct usb_driver qcdriver = {
116 .name = "qcserial",
117 .id_table = id_table,
118};
119
120static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) 115static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
121{ 116{
122 struct usb_wwan_intf_private *data; 117 struct usb_wwan_intf_private *data;
@@ -277,7 +272,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
277 &qcdevice, NULL 272 &qcdevice, NULL
278}; 273};
279 274
280module_usb_serial_driver(qcdriver, serial_drivers); 275module_usb_serial_driver(serial_drivers, id_table);
281 276
282MODULE_AUTHOR(DRIVER_AUTHOR); 277MODULE_AUTHOR(DRIVER_AUTHOR);
283MODULE_DESCRIPTION(DRIVER_DESC); 278MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/safe_serial.c b/drivers/usb/serial/safe_serial.c
index 546ea12455f3..36e9d9fc0618 100644
--- a/drivers/usb/serial/safe_serial.c
+++ b/drivers/usb/serial/safe_serial.c
@@ -151,11 +151,6 @@ static struct usb_device_id id_table[] = {
151 151
152MODULE_DEVICE_TABLE(usb, id_table); 152MODULE_DEVICE_TABLE(usb, id_table);
153 153
154static struct usb_driver safe_driver = {
155 .name = "safe_serial",
156 .id_table = id_table,
157};
158
159static const __u16 crc10_table[256] = { 154static const __u16 crc10_table[256] = {
160 0x000, 0x233, 0x255, 0x066, 0x299, 0x0aa, 0x0cc, 0x2ff, 155 0x000, 0x233, 0x255, 0x066, 0x299, 0x0aa, 0x0cc, 0x2ff,
161 0x301, 0x132, 0x154, 0x367, 0x198, 0x3ab, 0x3cd, 0x1fe, 156 0x301, 0x132, 0x154, 0x367, 0x198, 0x3ab, 0x3cd, 0x1fe,
@@ -337,12 +332,12 @@ static int __init safe_init(void)
337 } 332 }
338 } 333 }
339 334
340 return usb_serial_register_drivers(&safe_driver, serial_drivers); 335 return usb_serial_register_drivers(serial_drivers, KBUILD_MODNAME, id_table);
341} 336}
342 337
343static void __exit safe_exit(void) 338static void __exit safe_exit(void)
344{ 339{
345 usb_serial_deregister_drivers(&safe_driver, serial_drivers); 340 usb_serial_deregister_drivers(serial_drivers);
346} 341}
347 342
348module_init(safe_init); 343module_init(safe_init);
diff --git a/drivers/usb/serial/siemens_mpi.c b/drivers/usb/serial/siemens_mpi.c
index 0d3108af1d04..e4a1787cdbac 100644
--- a/drivers/usb/serial/siemens_mpi.c
+++ b/drivers/usb/serial/siemens_mpi.c
@@ -29,11 +29,6 @@ static const struct usb_device_id id_table[] = {
29}; 29};
30MODULE_DEVICE_TABLE(usb, id_table); 30MODULE_DEVICE_TABLE(usb, id_table);
31 31
32static struct usb_driver siemens_usb_mpi_driver = {
33 .name = "siemens_mpi",
34 .id_table = id_table,
35};
36
37static struct usb_serial_driver siemens_usb_mpi_device = { 32static struct usb_serial_driver siemens_usb_mpi_device = {
38 .driver = { 33 .driver = {
39 .owner = THIS_MODULE, 34 .owner = THIS_MODULE,
@@ -47,7 +42,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
47 &siemens_usb_mpi_device, NULL 42 &siemens_usb_mpi_device, NULL
48}; 43};
49 44
50module_usb_serial_driver(siemens_usb_mpi_driver, serial_drivers); 45module_usb_serial_driver(serial_drivers, id_table);
51 46
52MODULE_AUTHOR(DRIVER_AUTHOR); 47MODULE_AUTHOR(DRIVER_AUTHOR);
53MODULE_DESCRIPTION(DRIVER_DESC); 48MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index 1040f9d50451..ba54a0a8235c 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -1044,11 +1044,6 @@ static int sierra_resume(struct usb_serial *serial)
1044#define sierra_resume NULL 1044#define sierra_resume NULL
1045#endif 1045#endif
1046 1046
1047static struct usb_driver sierra_driver = {
1048 .name = "sierra",
1049 .id_table = id_table,
1050};
1051
1052static struct usb_serial_driver sierra_device = { 1047static struct usb_serial_driver sierra_device = {
1053 .driver = { 1048 .driver = {
1054 .owner = THIS_MODULE, 1049 .owner = THIS_MODULE,
@@ -1077,7 +1072,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
1077 &sierra_device, NULL 1072 &sierra_device, NULL
1078}; 1073};
1079 1074
1080module_usb_serial_driver(sierra_driver, serial_drivers); 1075module_usb_serial_driver(serial_drivers, id_table);
1081 1076
1082MODULE_AUTHOR(DRIVER_AUTHOR); 1077MODULE_AUTHOR(DRIVER_AUTHOR);
1083MODULE_DESCRIPTION(DRIVER_DESC); 1078MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c
index 51e43ccef10c..1fc1cab5a4ad 100644
--- a/drivers/usb/serial/spcp8x5.c
+++ b/drivers/usb/serial/spcp8x5.c
@@ -151,12 +151,6 @@ enum spcp8x5_type {
151 SPCP835_TYPE, 151 SPCP835_TYPE,
152}; 152};
153 153
154static struct usb_driver spcp8x5_driver = {
155 .name = "spcp8x5",
156 .id_table = id_table,
157};
158
159
160struct spcp8x5_private { 154struct spcp8x5_private {
161 spinlock_t lock; 155 spinlock_t lock;
162 enum spcp8x5_type type; 156 enum spcp8x5_type type;
@@ -662,7 +656,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
662 &spcp8x5_device, NULL 656 &spcp8x5_device, NULL
663}; 657};
664 658
665module_usb_serial_driver(spcp8x5_driver, serial_drivers); 659module_usb_serial_driver(serial_drivers, id_table);
666 660
667MODULE_DESCRIPTION(DRIVER_DESC); 661MODULE_DESCRIPTION(DRIVER_DESC);
668MODULE_VERSION(DRIVER_VERSION); 662MODULE_VERSION(DRIVER_VERSION);
diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c
index f72b03f83be2..3fee23bf0c14 100644
--- a/drivers/usb/serial/ssu100.c
+++ b/drivers/usb/serial/ssu100.c
@@ -59,15 +59,8 @@ static const struct usb_device_id id_table[] = {
59 {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_SSU100)}, 59 {USB_DEVICE(USB_VENDOR_ID_QUATECH, QUATECH_SSU100)},
60 {} /* Terminating entry */ 60 {} /* Terminating entry */
61}; 61};
62
63MODULE_DEVICE_TABLE(usb, id_table); 62MODULE_DEVICE_TABLE(usb, id_table);
64 63
65
66static struct usb_driver ssu100_driver = {
67 .name = "ssu100",
68 .id_table = id_table,
69};
70
71struct ssu100_port_private { 64struct ssu100_port_private {
72 spinlock_t status_lock; 65 spinlock_t status_lock;
73 u8 shadowLSR; 66 u8 shadowLSR;
@@ -671,7 +664,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
671 &ssu100_device, NULL 664 &ssu100_device, NULL
672}; 665};
673 666
674module_usb_serial_driver(ssu100_driver, serial_drivers); 667module_usb_serial_driver(serial_drivers, id_table);
675 668
676MODULE_DESCRIPTION(DRIVER_DESC); 669MODULE_DESCRIPTION(DRIVER_DESC);
677MODULE_LICENSE("GPL"); 670MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/symbolserial.c b/drivers/usb/serial/symbolserial.c
index 5ef07ca6fe92..f7c440541754 100644
--- a/drivers/usb/serial/symbolserial.c
+++ b/drivers/usb/serial/symbolserial.c
@@ -269,11 +269,6 @@ static void symbol_release(struct usb_serial *serial)
269 kfree(priv); 269 kfree(priv);
270} 270}
271 271
272static struct usb_driver symbol_driver = {
273 .name = "symbol",
274 .id_table = id_table,
275};
276
277static struct usb_serial_driver symbol_device = { 272static struct usb_serial_driver symbol_device = {
278 .driver = { 273 .driver = {
279 .owner = THIS_MODULE, 274 .owner = THIS_MODULE,
@@ -294,7 +289,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
294 &symbol_device, NULL 289 &symbol_device, NULL
295}; 290};
296 291
297module_usb_serial_driver(symbol_driver, serial_drivers); 292module_usb_serial_driver(serial_drivers, id_table);
298 293
299MODULE_LICENSE("GPL"); 294MODULE_LICENSE("GPL");
300 295
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index 9d96224494b8..a180b15d195a 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -211,11 +211,6 @@ static struct usb_device_id ti_id_table_combined[18+2*TI_EXTRA_VID_PID_COUNT+1]
211 { } 211 { }
212}; 212};
213 213
214static struct usb_driver ti_usb_driver = {
215 .name = "ti_usb_3410_5052",
216 .id_table = ti_id_table_combined,
217};
218
219static struct usb_serial_driver ti_1port_device = { 214static struct usb_serial_driver ti_1port_device = {
220 .driver = { 215 .driver = {
221 .owner = THIS_MODULE, 216 .owner = THIS_MODULE,
@@ -342,20 +337,18 @@ static int __init ti_init(void)
342 ti_id_table_combined[c].match_flags = USB_DEVICE_ID_MATCH_DEVICE; 337 ti_id_table_combined[c].match_flags = USB_DEVICE_ID_MATCH_DEVICE;
343 } 338 }
344 339
345 ret = usb_serial_register_drivers(&ti_usb_driver, serial_drivers); 340 ret = usb_serial_register_drivers(serial_drivers, KBUILD_MODNAME, ti_id_table_combined);
346 if (ret == 0) 341 if (ret == 0)
347 printk(KERN_INFO KBUILD_MODNAME ": " TI_DRIVER_VERSION ":" 342 printk(KERN_INFO KBUILD_MODNAME ": " TI_DRIVER_VERSION ":"
348 TI_DRIVER_DESC "\n"); 343 TI_DRIVER_DESC "\n");
349 return ret; 344 return ret;
350} 345}
351 346
352
353static void __exit ti_exit(void) 347static void __exit ti_exit(void)
354{ 348{
355 usb_serial_deregister_drivers(&ti_usb_driver, serial_drivers); 349 usb_serial_deregister_drivers(serial_drivers);
356} 350}
357 351
358
359module_init(ti_init); 352module_init(ti_init);
360module_exit(ti_exit); 353module_exit(ti_exit);
361 354
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index d1840aef0d53..62dd92270525 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -1364,18 +1364,19 @@ static void usb_serial_deregister(struct usb_serial_driver *device)
1364 1364
1365/** 1365/**
1366 * usb_serial_register_drivers - register drivers for a usb-serial module 1366 * usb_serial_register_drivers - register drivers for a usb-serial module
1367 * @udriver: usb_driver used for matching devices/interfaces
1368 * @serial_drivers: NULL-terminated array of pointers to drivers to be registered 1367 * @serial_drivers: NULL-terminated array of pointers to drivers to be registered
1368 * @name: name of the usb_driver for this set of @serial_drivers
1369 * @id_table: list of all devices this @serial_drivers set binds to
1369 * 1370 *
1370 * Registers @udriver and all the drivers in the @serial_drivers array. 1371 * Registers all the drivers in the @serial_drivers array, and dynamically
1371 * Automatically fills in the .no_dynamic_id and PM fields in @udriver and 1372 * creates a struct usb_driver with the name @name and id_table of @id_table.
1372 * the .usb_driver field in each serial driver.
1373 */ 1373 */
1374int usb_serial_register_drivers(struct usb_driver *udriver, 1374int usb_serial_register_drivers(struct usb_serial_driver *const serial_drivers[],
1375 struct usb_serial_driver * const serial_drivers[]) 1375 const char *name,
1376 const struct usb_device_id *id_table)
1376{ 1377{
1377 int rc; 1378 int rc;
1378 const struct usb_device_id *saved_id_table; 1379 struct usb_driver *udriver;
1379 struct usb_serial_driver * const *sd; 1380 struct usb_serial_driver * const *sd;
1380 1381
1381 /* 1382 /*
@@ -1386,14 +1387,16 @@ int usb_serial_register_drivers(struct usb_driver *udriver,
1386 * Performance hack: We don't want udriver to be probed until 1387 * Performance hack: We don't want udriver to be probed until
1387 * the serial drivers are registered, because the probe would 1388 * the serial drivers are registered, because the probe would
1388 * simply fail for lack of a matching serial driver. 1389 * simply fail for lack of a matching serial driver.
1389 * Therefore save off udriver's id_table until we are all set. 1390 * So we leave udriver's id_table set to NULL until we are all set.
1390 * 1391 *
1391 * Suspend/resume support is implemented in the usb-serial core, 1392 * Suspend/resume support is implemented in the usb-serial core,
1392 * so fill in the PM-related fields in udriver. 1393 * so fill in the PM-related fields in udriver.
1393 */ 1394 */
1394 saved_id_table = udriver->id_table; 1395 udriver = kzalloc(sizeof(*udriver), GFP_KERNEL);
1395 udriver->id_table = NULL; 1396 if (!udriver)
1397 return -ENOMEM;
1396 1398
1399 udriver->name = name;
1397 udriver->no_dynamic_id = 1; 1400 udriver->no_dynamic_id = 1;
1398 udriver->supports_autosuspend = 1; 1401 udriver->supports_autosuspend = 1;
1399 udriver->suspend = usb_serial_suspend; 1402 udriver->suspend = usb_serial_suspend;
@@ -1411,8 +1414,8 @@ int usb_serial_register_drivers(struct usb_driver *udriver,
1411 goto failed; 1414 goto failed;
1412 } 1415 }
1413 1416
1414 /* Now restore udriver's id_table and look for matches */ 1417 /* Now set udriver's id_table and look for matches */
1415 udriver->id_table = saved_id_table; 1418 udriver->id_table = id_table;
1416 rc = driver_attach(&udriver->drvwrap.driver); 1419 rc = driver_attach(&udriver->drvwrap.driver);
1417 return 0; 1420 return 0;
1418 1421
@@ -1426,17 +1429,20 @@ EXPORT_SYMBOL_GPL(usb_serial_register_drivers);
1426 1429
1427/** 1430/**
1428 * usb_serial_deregister_drivers - deregister drivers for a usb-serial module 1431 * usb_serial_deregister_drivers - deregister drivers for a usb-serial module
1429 * @udriver: usb_driver to unregister
1430 * @serial_drivers: NULL-terminated array of pointers to drivers to be deregistered 1432 * @serial_drivers: NULL-terminated array of pointers to drivers to be deregistered
1431 * 1433 *
1432 * Deregisters @udriver and all the drivers in the @serial_drivers array. 1434 * Deregisters all the drivers in the @serial_drivers array and deregisters and
1435 * frees the struct usb_driver that was created by the call to
1436 * usb_serial_register_drivers().
1433 */ 1437 */
1434void usb_serial_deregister_drivers(struct usb_driver *udriver, 1438void usb_serial_deregister_drivers(struct usb_serial_driver *const serial_drivers[])
1435 struct usb_serial_driver * const serial_drivers[])
1436{ 1439{
1440 struct usb_driver *udriver = (*serial_drivers)->usb_driver;
1441
1437 for (; *serial_drivers; ++serial_drivers) 1442 for (; *serial_drivers; ++serial_drivers)
1438 usb_serial_deregister(*serial_drivers); 1443 usb_serial_deregister(*serial_drivers);
1439 usb_deregister(udriver); 1444 usb_deregister(udriver);
1445 kfree(udriver);
1440} 1446}
1441EXPORT_SYMBOL_GPL(usb_serial_deregister_drivers); 1447EXPORT_SYMBOL_GPL(usb_serial_deregister_drivers);
1442 1448
diff --git a/drivers/usb/serial/usb_debug.c b/drivers/usb/serial/usb_debug.c
index e22e5435ff96..5760f97ee508 100644
--- a/drivers/usb/serial/usb_debug.c
+++ b/drivers/usb/serial/usb_debug.c
@@ -35,11 +35,6 @@ static const struct usb_device_id id_table[] = {
35}; 35};
36MODULE_DEVICE_TABLE(usb, id_table); 36MODULE_DEVICE_TABLE(usb, id_table);
37 37
38static struct usb_driver debug_driver = {
39 .name = "debug",
40 .id_table = id_table,
41};
42
43/* This HW really does not support a serial break, so one will be 38/* This HW really does not support a serial break, so one will be
44 * emulated when ever the break state is set to true. 39 * emulated when ever the break state is set to true.
45 */ 40 */
@@ -81,5 +76,5 @@ static struct usb_serial_driver * const serial_drivers[] = {
81 &debug_device, NULL 76 &debug_device, NULL
82}; 77};
83 78
84module_usb_serial_driver(debug_driver, serial_drivers); 79module_usb_serial_driver(serial_drivers, id_table);
85MODULE_LICENSE("GPL"); 80MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index 2e24bd34754c..f253c91383da 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -163,11 +163,6 @@ static struct usb_device_id id_table_combined [] = {
163 163
164MODULE_DEVICE_TABLE(usb, id_table_combined); 164MODULE_DEVICE_TABLE(usb, id_table_combined);
165 165
166static struct usb_driver visor_driver = {
167 .name = "visor",
168 .id_table = id_table_combined,
169};
170
171/* All of the device info needed for the Handspring Visor, 166/* All of the device info needed for the Handspring Visor,
172 and Palm 4.0 devices */ 167 and Palm 4.0 devices */
173static struct usb_serial_driver handspring_device = { 168static struct usb_serial_driver handspring_device = {
@@ -625,7 +620,7 @@ static int clie_5_attach(struct usb_serial *serial)
625 return 0; 620 return 0;
626} 621}
627 622
628module_usb_serial_driver(visor_driver, serial_drivers); 623module_usb_serial_driver(serial_drivers, id_table_combined);
629 624
630MODULE_AUTHOR(DRIVER_AUTHOR); 625MODULE_AUTHOR(DRIVER_AUTHOR);
631MODULE_DESCRIPTION(DRIVER_DESC); 626MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/vivopay-serial.c b/drivers/usb/serial/vivopay-serial.c
index c7d8ab359454..0c0aa876c209 100644
--- a/drivers/usb/serial/vivopay-serial.c
+++ b/drivers/usb/serial/vivopay-serial.c
@@ -25,11 +25,6 @@ static struct usb_device_id id_table [] = {
25 25
26MODULE_DEVICE_TABLE(usb, id_table); 26MODULE_DEVICE_TABLE(usb, id_table);
27 27
28static struct usb_driver vivopay_serial_driver = {
29 .name = "vivopay-serial",
30 .id_table = id_table,
31};
32
33static struct usb_serial_driver vivopay_serial_device = { 28static struct usb_serial_driver vivopay_serial_device = {
34 .driver = { 29 .driver = {
35 .owner = THIS_MODULE, 30 .owner = THIS_MODULE,
@@ -43,7 +38,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
43 &vivopay_serial_device, NULL 38 &vivopay_serial_device, NULL
44}; 39};
45 40
46module_usb_serial_driver(vivopay_serial_driver, serial_drivers); 41module_usb_serial_driver(serial_drivers, id_table);
47 42
48MODULE_AUTHOR("Forest Bond <forest.bond@outpostembedded.com>"); 43MODULE_AUTHOR("Forest Bond <forest.bond@outpostembedded.com>");
49MODULE_DESCRIPTION(DRIVER_DESC); 44MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index 76840cdb818d..473635e7f5db 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -77,10 +77,6 @@ static const struct usb_device_id id_table_combined[] = {
77 77
78MODULE_DEVICE_TABLE(usb, id_table_combined); 78MODULE_DEVICE_TABLE(usb, id_table_combined);
79 79
80static struct usb_driver whiteheat_driver = {
81 .name = "whiteheat",
82 .id_table = id_table_combined,
83};
84 80
85/* function prototypes for the Connect Tech WhiteHEAT prerenumeration device */ 81/* function prototypes for the Connect Tech WhiteHEAT prerenumeration device */
86static int whiteheat_firmware_download(struct usb_serial *serial, 82static int whiteheat_firmware_download(struct usb_serial *serial,
@@ -914,7 +910,7 @@ static void stop_command_port(struct usb_serial *serial)
914 mutex_unlock(&command_info->mutex); 910 mutex_unlock(&command_info->mutex);
915} 911}
916 912
917module_usb_serial_driver(whiteheat_driver, serial_drivers); 913module_usb_serial_driver(serial_drivers, id_table_combined);
918 914
919MODULE_AUTHOR(DRIVER_AUTHOR); 915MODULE_AUTHOR(DRIVER_AUTHOR);
920MODULE_DESCRIPTION(DRIVER_DESC); 916MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/usb/serial/zio.c b/drivers/usb/serial/zio.c
index 4822cc84a668..c043aa84a0ba 100644
--- a/drivers/usb/serial/zio.c
+++ b/drivers/usb/serial/zio.c
@@ -22,11 +22,6 @@ static const struct usb_device_id id_table[] = {
22}; 22};
23MODULE_DEVICE_TABLE(usb, id_table); 23MODULE_DEVICE_TABLE(usb, id_table);
24 24
25static struct usb_driver zio_driver = {
26 .name = "zio",
27 .id_table = id_table,
28};
29
30static struct usb_serial_driver zio_device = { 25static struct usb_serial_driver zio_device = {
31 .driver = { 26 .driver = {
32 .owner = THIS_MODULE, 27 .owner = THIS_MODULE,
@@ -40,5 +35,5 @@ static struct usb_serial_driver * const serial_drivers[] = {
40 &zio_device, NULL 35 &zio_device, NULL
41}; 36};
42 37
43module_usb_serial_driver(zio_driver, serial_drivers); 38module_usb_serial_driver(serial_drivers, id_table);
44MODULE_LICENSE("GPL"); 39MODULE_LICENSE("GPL");
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 749836f2890c..c9f65146a039 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -292,10 +292,9 @@ struct usb_serial_driver {
292#define to_usb_serial_driver(d) \ 292#define to_usb_serial_driver(d) \
293 container_of(d, struct usb_serial_driver, driver) 293 container_of(d, struct usb_serial_driver, driver)
294 294
295extern int usb_serial_register_drivers(struct usb_driver *udriver, 295extern int usb_serial_register_drivers(struct usb_serial_driver *const serial_drivers[],
296 struct usb_serial_driver * const serial_drivers[]); 296 const char *name, const struct usb_device_id *id_table);
297extern void usb_serial_deregister_drivers(struct usb_driver *udriver, 297extern void usb_serial_deregister_drivers(struct usb_serial_driver *const serial_drivers[]);
298 struct usb_serial_driver * const serial_drivers[]);
299extern void usb_serial_port_softint(struct usb_serial_port *port); 298extern void usb_serial_port_softint(struct usb_serial_port *port);
300 299
301extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message); 300extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message);
@@ -396,8 +395,8 @@ do { \
396 395
397/* 396/*
398 * module_usb_serial_driver() - Helper macro for registering a USB Serial driver 397 * module_usb_serial_driver() - Helper macro for registering a USB Serial driver
399 * @__usb_driver: usb_driver struct to register
400 * @__serial_drivers: list of usb_serial drivers to register 398 * @__serial_drivers: list of usb_serial drivers to register
399 * @__ids: all device ids that @__serial_drivers bind to
401 * 400 *
402 * Helper macro for USB serial drivers which do not do anything special 401 * Helper macro for USB serial drivers which do not do anything special
403 * in module init/exit. This eliminates a lot of boilerplate. Each 402 * in module init/exit. This eliminates a lot of boilerplate. Each
@@ -405,9 +404,21 @@ do { \
405 * module_init() and module_exit() 404 * module_init() and module_exit()
406 * 405 *
407 */ 406 */
408#define module_usb_serial_driver(__usb_driver, __serial_drivers) \ 407#define usb_serial_module_driver(__name, __serial_drivers, __ids) \
409 module_driver(__usb_driver, usb_serial_register_drivers, \ 408static int __init usb_serial_module_init(void) \
410 usb_serial_deregister_drivers, __serial_drivers) 409{ \
410 return usb_serial_register_drivers(__serial_drivers, \
411 __name, __ids); \
412} \
413module_init(usb_serial_module_init); \
414static void __exit usb_serial_module_exit(void) \
415{ \
416 usb_serial_deregister_drivers(__serial_drivers); \
417} \
418module_exit(usb_serial_module_exit);
419
420#define module_usb_serial_driver(__serial_drivers, __ids) \
421 usb_serial_module_driver(KBUILD_MODNAME, __serial_drivers, __ids)
411 422
412#endif /* __LINUX_USB_SERIAL_H */ 423#endif /* __LINUX_USB_SERIAL_H */
413 424