aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/empeg.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-02-23 14:56:32 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-24 15:39:18 -0500
commit97b6b6d2339f67eb17d954930a908b762af66228 (patch)
tree955eb92c831f444e26a930b3cd301393bb7112a0 /drivers/usb/serial/empeg.c
parent08a4f6bc2e7046ce50849d7589b7d0763926d808 (diff)
usb-serial: use new registration API in [d-h]* drivers
This patch (as1524) modifies the following usb-serial drivers to utilize the new usb_serial_{de}register_drivers() routines: digi_acceleport, empeg, ftdi_sio, funsoft, garmin_gps, and hp4x. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/empeg.c')
-rw-r--r--drivers/usb/serial/empeg.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c
index aced6817bf95..51bcbd5d5e8e 100644
--- a/drivers/usb/serial/empeg.c
+++ b/drivers/usb/serial/empeg.c
@@ -56,7 +56,6 @@ static struct usb_driver empeg_driver = {
56 .probe = usb_serial_probe, 56 .probe = usb_serial_probe,
57 .disconnect = usb_serial_disconnect, 57 .disconnect = usb_serial_disconnect,
58 .id_table = id_table, 58 .id_table = id_table,
59 .no_dynamic_id = 1,
60}; 59};
61 60
62static struct usb_serial_driver empeg_device = { 61static struct usb_serial_driver empeg_device = {
@@ -65,7 +64,6 @@ static struct usb_serial_driver empeg_device = {
65 .name = "empeg", 64 .name = "empeg",
66 }, 65 },
67 .id_table = id_table, 66 .id_table = id_table,
68 .usb_driver = &empeg_driver,
69 .num_ports = 1, 67 .num_ports = 1,
70 .bulk_out_size = 256, 68 .bulk_out_size = 256,
71 .throttle = usb_serial_generic_throttle, 69 .throttle = usb_serial_generic_throttle,
@@ -74,6 +72,10 @@ static struct usb_serial_driver empeg_device = {
74 .init_termios = empeg_init_termios, 72 .init_termios = empeg_init_termios,
75}; 73};
76 74
75static struct usb_serial_driver * const serial_drivers[] = {
76 &empeg_device, NULL
77};
78
77static int empeg_startup(struct usb_serial *serial) 79static int empeg_startup(struct usb_serial *serial)
78{ 80{
79 int r; 81 int r;
@@ -140,24 +142,16 @@ static int __init empeg_init(void)
140{ 142{
141 int retval; 143 int retval;
142 144
143 retval = usb_serial_register(&empeg_device); 145 retval = usb_serial_register_drivers(&empeg_driver, serial_drivers);
144 if (retval) 146 if (retval == 0)
145 return retval; 147 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
146 retval = usb_register(&empeg_driver); 148 DRIVER_DESC "\n");
147 if (retval) { 149 return retval;
148 usb_serial_deregister(&empeg_device);
149 return retval;
150 }
151 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
152 DRIVER_DESC "\n");
153
154 return 0;
155} 150}
156 151
157static void __exit empeg_exit(void) 152static void __exit empeg_exit(void)
158{ 153{
159 usb_deregister(&empeg_driver); 154 usb_serial_deregister_drivers(&empeg_driver, serial_drivers);
160 usb_serial_deregister(&empeg_device);
161} 155}
162 156
163 157