diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-02-23 14:57:32 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-24 15:39:21 -0500 |
commit | 29618e9fb5507b9fcf07f739a8506a3640495945 (patch) | |
tree | d5b05698811d39a6068bd8bfae99e04cb6da4e8f /drivers/usb/serial/visor.c | |
parent | d860322f34e4a53f347b1aeae23d5b72f1e91b8c (diff) |
usb-serial: use new registration API in [t-z]* drivers
This patch (as1529) modifies the following usb-serial drivers to
utilize the new usb_serial_{de}register_drivers() routines:
ti_usb_3410_5052, usb_debug, visor, vivopay-serial,
whiteheat, and zio.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/visor.c')
-rw-r--r-- | drivers/usb/serial/visor.c | 37 |
1 files changed, 8 insertions, 29 deletions
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index 210e4b10dc11..71d696474f24 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c | |||
@@ -173,7 +173,6 @@ static struct usb_driver visor_driver = { | |||
173 | .probe = usb_serial_probe, | 173 | .probe = usb_serial_probe, |
174 | .disconnect = usb_serial_disconnect, | 174 | .disconnect = usb_serial_disconnect, |
175 | .id_table = id_table_combined, | 175 | .id_table = id_table_combined, |
176 | .no_dynamic_id = 1, | ||
177 | }; | 176 | }; |
178 | 177 | ||
179 | /* All of the device info needed for the Handspring Visor, | 178 | /* All of the device info needed for the Handspring Visor, |
@@ -184,7 +183,6 @@ static struct usb_serial_driver handspring_device = { | |||
184 | .name = "visor", | 183 | .name = "visor", |
185 | }, | 184 | }, |
186 | .description = "Handspring Visor / Palm OS", | 185 | .description = "Handspring Visor / Palm OS", |
187 | .usb_driver = &visor_driver, | ||
188 | .id_table = id_table, | 186 | .id_table = id_table, |
189 | .num_ports = 2, | 187 | .num_ports = 2, |
190 | .bulk_out_size = 256, | 188 | .bulk_out_size = 256, |
@@ -205,7 +203,6 @@ static struct usb_serial_driver clie_5_device = { | |||
205 | .name = "clie_5", | 203 | .name = "clie_5", |
206 | }, | 204 | }, |
207 | .description = "Sony Clie 5.0", | 205 | .description = "Sony Clie 5.0", |
208 | .usb_driver = &visor_driver, | ||
209 | .id_table = clie_id_5_table, | 206 | .id_table = clie_id_5_table, |
210 | .num_ports = 2, | 207 | .num_ports = 2, |
211 | .bulk_out_size = 256, | 208 | .bulk_out_size = 256, |
@@ -226,7 +223,6 @@ static struct usb_serial_driver clie_3_5_device = { | |||
226 | .name = "clie_3.5", | 223 | .name = "clie_3.5", |
227 | }, | 224 | }, |
228 | .description = "Sony Clie 3.5", | 225 | .description = "Sony Clie 3.5", |
229 | .usb_driver = &visor_driver, | ||
230 | .id_table = clie_id_3_5_table, | 226 | .id_table = clie_id_3_5_table, |
231 | .num_ports = 1, | 227 | .num_ports = 1, |
232 | .bulk_out_size = 256, | 228 | .bulk_out_size = 256, |
@@ -237,6 +233,10 @@ static struct usb_serial_driver clie_3_5_device = { | |||
237 | .attach = clie_3_5_startup, | 233 | .attach = clie_3_5_startup, |
238 | }; | 234 | }; |
239 | 235 | ||
236 | static struct usb_serial_driver * const serial_drivers[] = { | ||
237 | &handspring_device, &clie_5_device, &clie_3_5_device, NULL | ||
238 | }; | ||
239 | |||
240 | /****************************************************************************** | 240 | /****************************************************************************** |
241 | * Handspring Visor specific driver functions | 241 | * Handspring Visor specific driver functions |
242 | ******************************************************************************/ | 242 | ******************************************************************************/ |
@@ -685,38 +685,17 @@ static int __init visor_init(void) | |||
685 | ": Adding Palm OS protocol 4.x support for unknown device: 0x%x/0x%x\n", | 685 | ": Adding Palm OS protocol 4.x support for unknown device: 0x%x/0x%x\n", |
686 | vendor, product); | 686 | vendor, product); |
687 | } | 687 | } |
688 | retval = usb_serial_register(&handspring_device); | ||
689 | if (retval) | ||
690 | goto failed_handspring_register; | ||
691 | retval = usb_serial_register(&clie_3_5_device); | ||
692 | if (retval) | ||
693 | goto failed_clie_3_5_register; | ||
694 | retval = usb_serial_register(&clie_5_device); | ||
695 | if (retval) | ||
696 | goto failed_clie_5_register; | ||
697 | retval = usb_register(&visor_driver); | ||
698 | if (retval) | ||
699 | goto failed_usb_register; | ||
700 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n"); | ||
701 | 688 | ||
702 | return 0; | 689 | retval = usb_serial_register_drivers(&visor_driver, serial_drivers); |
703 | failed_usb_register: | 690 | if (retval == 0) |
704 | usb_serial_deregister(&clie_5_device); | 691 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n"); |
705 | failed_clie_5_register: | ||
706 | usb_serial_deregister(&clie_3_5_device); | ||
707 | failed_clie_3_5_register: | ||
708 | usb_serial_deregister(&handspring_device); | ||
709 | failed_handspring_register: | ||
710 | return retval; | 692 | return retval; |
711 | } | 693 | } |
712 | 694 | ||
713 | 695 | ||
714 | static void __exit visor_exit (void) | 696 | static void __exit visor_exit (void) |
715 | { | 697 | { |
716 | usb_deregister(&visor_driver); | 698 | usb_serial_deregister_drivers(&visor_driver, serial_drivers); |
717 | usb_serial_deregister(&handspring_device); | ||
718 | usb_serial_deregister(&clie_3_5_device); | ||
719 | usb_serial_deregister(&clie_5_device); | ||
720 | } | 699 | } |
721 | 700 | ||
722 | 701 | ||