diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-02-23 14:56:17 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-24 15:39:17 -0500 |
commit | 08a4f6bc2e7046ce50849d7589b7d0763926d808 (patch) | |
tree | 9c2f247154db1872ef71e9c5ec8afbdd87e02b83 /drivers/usb/serial/cyberjack.c | |
parent | 765e0ba62613fb90f09c1b5926750df0aa56f349 (diff) |
usb-serial: use new registration API in [a-c]* drivers
This patch (as1523) modifies the following usb-serial drivers to
utilize the new usb_serial_{de}register_drivers() routines:
aircable, ark3116, belkin_sa, ch341, cp210x, cyberjack,
and cypress_m8.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/cyberjack.c')
-rw-r--r-- | drivers/usb/serial/cyberjack.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c index 6bc3802a581a..d2e536f649ba 100644 --- a/drivers/usb/serial/cyberjack.c +++ b/drivers/usb/serial/cyberjack.c | |||
@@ -82,7 +82,6 @@ static struct usb_driver cyberjack_driver = { | |||
82 | .probe = usb_serial_probe, | 82 | .probe = usb_serial_probe, |
83 | .disconnect = usb_serial_disconnect, | 83 | .disconnect = usb_serial_disconnect, |
84 | .id_table = id_table, | 84 | .id_table = id_table, |
85 | .no_dynamic_id = 1, | ||
86 | }; | 85 | }; |
87 | 86 | ||
88 | static struct usb_serial_driver cyberjack_device = { | 87 | static struct usb_serial_driver cyberjack_device = { |
@@ -91,7 +90,6 @@ static struct usb_serial_driver cyberjack_device = { | |||
91 | .name = "cyberjack", | 90 | .name = "cyberjack", |
92 | }, | 91 | }, |
93 | .description = "Reiner SCT Cyberjack USB card reader", | 92 | .description = "Reiner SCT Cyberjack USB card reader", |
94 | .usb_driver = &cyberjack_driver, | ||
95 | .id_table = id_table, | 93 | .id_table = id_table, |
96 | .num_ports = 1, | 94 | .num_ports = 1, |
97 | .attach = cyberjack_startup, | 95 | .attach = cyberjack_startup, |
@@ -106,6 +104,10 @@ static struct usb_serial_driver cyberjack_device = { | |||
106 | .write_bulk_callback = cyberjack_write_bulk_callback, | 104 | .write_bulk_callback = cyberjack_write_bulk_callback, |
107 | }; | 105 | }; |
108 | 106 | ||
107 | static struct usb_serial_driver * const serial_drivers[] = { | ||
108 | &cyberjack_device, NULL | ||
109 | }; | ||
110 | |||
109 | struct cyberjack_private { | 111 | struct cyberjack_private { |
110 | spinlock_t lock; /* Lock for SMP */ | 112 | spinlock_t lock; /* Lock for SMP */ |
111 | short rdtodo; /* Bytes still to read */ | 113 | short rdtodo; /* Bytes still to read */ |
@@ -476,28 +478,19 @@ exit: | |||
476 | static int __init cyberjack_init(void) | 478 | static int __init cyberjack_init(void) |
477 | { | 479 | { |
478 | int retval; | 480 | int retval; |
479 | retval = usb_serial_register(&cyberjack_device); | ||
480 | if (retval) | ||
481 | goto failed_usb_serial_register; | ||
482 | retval = usb_register(&cyberjack_driver); | ||
483 | if (retval) | ||
484 | goto failed_usb_register; | ||
485 | |||
486 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION " " | ||
487 | DRIVER_AUTHOR "\n"); | ||
488 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n"); | ||
489 | 481 | ||
490 | return 0; | 482 | retval = usb_serial_register_drivers(&cyberjack_driver, serial_drivers); |
491 | failed_usb_register: | 483 | if (retval == 0) { |
492 | usb_serial_deregister(&cyberjack_device); | 484 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION " " |
493 | failed_usb_serial_register: | 485 | DRIVER_AUTHOR "\n"); |
486 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n"); | ||
487 | } | ||
494 | return retval; | 488 | return retval; |
495 | } | 489 | } |
496 | 490 | ||
497 | static void __exit cyberjack_exit(void) | 491 | static void __exit cyberjack_exit(void) |
498 | { | 492 | { |
499 | usb_deregister(&cyberjack_driver); | 493 | usb_serial_deregister_drivers(&cyberjack_driver, serial_drivers); |
500 | usb_serial_deregister(&cyberjack_device); | ||
501 | } | 494 | } |
502 | 495 | ||
503 | module_init(cyberjack_init); | 496 | module_init(cyberjack_init); |