aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/cp210x.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-02-23 14:56:17 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-24 15:39:17 -0500
commit08a4f6bc2e7046ce50849d7589b7d0763926d808 (patch)
tree9c2f247154db1872ef71e9c5ec8afbdd87e02b83 /drivers/usb/serial/cp210x.c
parent765e0ba62613fb90f09c1b5926750df0aa56f349 (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/cp210x.c')
-rw-r--r--drivers/usb/serial/cp210x.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index ec9dc4e9a3ff..01a9374357f1 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -154,7 +154,6 @@ static struct usb_driver cp210x_driver = {
154 .probe = usb_serial_probe, 154 .probe = usb_serial_probe,
155 .disconnect = usb_serial_disconnect, 155 .disconnect = usb_serial_disconnect,
156 .id_table = id_table, 156 .id_table = id_table,
157 .no_dynamic_id = 1,
158}; 157};
159 158
160static struct usb_serial_driver cp210x_device = { 159static struct usb_serial_driver cp210x_device = {
@@ -162,7 +161,6 @@ static struct usb_serial_driver cp210x_device = {
162 .owner = THIS_MODULE, 161 .owner = THIS_MODULE,
163 .name = "cp210x", 162 .name = "cp210x",
164 }, 163 },
165 .usb_driver = &cp210x_driver,
166 .id_table = id_table, 164 .id_table = id_table,
167 .num_ports = 1, 165 .num_ports = 1,
168 .bulk_in_size = 256, 166 .bulk_in_size = 256,
@@ -177,6 +175,10 @@ static struct usb_serial_driver cp210x_device = {
177 .dtr_rts = cp210x_dtr_rts 175 .dtr_rts = cp210x_dtr_rts
178}; 176};
179 177
178static struct usb_serial_driver * const serial_drivers[] = {
179 &cp210x_device, NULL
180};
181
180/* Config request types */ 182/* Config request types */
181#define REQTYPE_HOST_TO_DEVICE 0x41 183#define REQTYPE_HOST_TO_DEVICE 0x41
182#define REQTYPE_DEVICE_TO_HOST 0xc1 184#define REQTYPE_DEVICE_TO_HOST 0xc1
@@ -852,27 +854,16 @@ static int __init cp210x_init(void)
852{ 854{
853 int retval; 855 int retval;
854 856
855 retval = usb_serial_register(&cp210x_device); 857 retval = usb_serial_register_drivers(&cp210x_driver, serial_drivers);
856 if (retval) 858 if (retval == 0)
857 return retval; /* Failed to register */ 859 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
858 860 DRIVER_DESC "\n");
859 retval = usb_register(&cp210x_driver); 861 return retval;
860 if (retval) {
861 /* Failed to register */
862 usb_serial_deregister(&cp210x_device);
863 return retval;
864 }
865
866 /* Success */
867 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
868 DRIVER_DESC "\n");
869 return 0;
870} 862}
871 863
872static void __exit cp210x_exit(void) 864static void __exit cp210x_exit(void)
873{ 865{
874 usb_deregister(&cp210x_driver); 866 usb_serial_deregister_drivers(&cp210x_driver, serial_drivers);
875 usb_serial_deregister(&cp210x_device);
876} 867}
877 868
878module_init(cp210x_init); 869module_init(cp210x_init);