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>
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index ec9dc4e..01a9374 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -154,7 +154,6 @@
.probe = usb_serial_probe,
.disconnect = usb_serial_disconnect,
.id_table = id_table,
- .no_dynamic_id = 1,
};
static struct usb_serial_driver cp210x_device = {
@@ -162,7 +161,6 @@
.owner = THIS_MODULE,
.name = "cp210x",
},
- .usb_driver = &cp210x_driver,
.id_table = id_table,
.num_ports = 1,
.bulk_in_size = 256,
@@ -177,6 +175,10 @@
.dtr_rts = cp210x_dtr_rts
};
+static struct usb_serial_driver * const serial_drivers[] = {
+ &cp210x_device, NULL
+};
+
/* Config request types */
#define REQTYPE_HOST_TO_DEVICE 0x41
#define REQTYPE_DEVICE_TO_HOST 0xc1
@@ -852,27 +854,16 @@
{
int retval;
- retval = usb_serial_register(&cp210x_device);
- if (retval)
- return retval; /* Failed to register */
-
- retval = usb_register(&cp210x_driver);
- if (retval) {
- /* Failed to register */
- usb_serial_deregister(&cp210x_device);
- return retval;
- }
-
- /* Success */
- printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
- DRIVER_DESC "\n");
- return 0;
+ retval = usb_serial_register_drivers(&cp210x_driver, serial_drivers);
+ if (retval == 0)
+ printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
+ DRIVER_DESC "\n");
+ return retval;
}
static void __exit cp210x_exit(void)
{
- usb_deregister(&cp210x_driver);
- usb_serial_deregister(&cp210x_device);
+ usb_serial_deregister_drivers(&cp210x_driver, serial_drivers);
}
module_init(cp210x_init);