diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-02-23 20:56:17 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-24 21:39:17 +0100 |
commit | 08a4f6bc2e7046ce50849d7589b7d0763926d808 (patch) | |
tree | 9c2f247154db1872ef71e9c5ec8afbdd87e02b83 /drivers/usb/serial/cypress_m8.c | |
parent | usb-serial: new API for driver registration (diff) | |
download | linux-08a4f6bc2e7046ce50849d7589b7d0763926d808.tar.xz linux-08a4f6bc2e7046ce50849d7589b7d0763926d808.zip |
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/cypress_m8.c')
-rw-r--r-- | drivers/usb/serial/cypress_m8.c | 42 |
1 files changed, 10 insertions, 32 deletions
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index 5ae86b349cad..bc5057513d5d 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c @@ -94,7 +94,6 @@ static struct usb_driver cypress_driver = { .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table_combined, - .no_dynamic_id = 1, }; enum packet_format { @@ -163,7 +162,6 @@ static struct usb_serial_driver cypress_earthmate_device = { .name = "earthmate", }, .description = "DeLorme Earthmate USB", - .usb_driver = &cypress_driver, .id_table = id_table_earthmate, .num_ports = 1, .attach = cypress_earthmate_startup, @@ -190,7 +188,6 @@ static struct usb_serial_driver cypress_hidcom_device = { .name = "cyphidcom", }, .description = "HID->COM RS232 Adapter", - .usb_driver = &cypress_driver, .id_table = id_table_cyphidcomrs232, .num_ports = 1, .attach = cypress_hidcom_startup, @@ -217,7 +214,6 @@ static struct usb_serial_driver cypress_ca42v2_device = { .name = "nokiaca42v2", }, .description = "Nokia CA-42 V2 Adapter", - .usb_driver = &cypress_driver, .id_table = id_table_nokiaca42v2, .num_ports = 1, .attach = cypress_ca42v2_startup, @@ -238,6 +234,11 @@ static struct usb_serial_driver cypress_ca42v2_device = { .write_int_callback = cypress_write_int_callback, }; +static struct usb_serial_driver * const serial_drivers[] = { + &cypress_earthmate_device, &cypress_hidcom_device, + &cypress_ca42v2_device, NULL +}; + /***************************************************************************** * Cypress serial helper functions *****************************************************************************/ @@ -1356,30 +1357,10 @@ static int __init cypress_init(void) dbg("%s", __func__); - retval = usb_serial_register(&cypress_earthmate_device); - if (retval) - goto failed_em_register; - retval = usb_serial_register(&cypress_hidcom_device); - if (retval) - goto failed_hidcom_register; - retval = usb_serial_register(&cypress_ca42v2_device); - if (retval) - goto failed_ca42v2_register; - retval = usb_register(&cypress_driver); - if (retval) - goto failed_usb_register; - - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" - DRIVER_DESC "\n"); - return 0; - -failed_usb_register: - usb_serial_deregister(&cypress_ca42v2_device); -failed_ca42v2_register: - usb_serial_deregister(&cypress_hidcom_device); -failed_hidcom_register: - usb_serial_deregister(&cypress_earthmate_device); -failed_em_register: + retval = usb_serial_register_drivers(&cypress_driver, serial_drivers); + if (retval == 0) + printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" + DRIVER_DESC "\n"); return retval; } @@ -1388,10 +1369,7 @@ static void __exit cypress_exit(void) { dbg("%s", __func__); - usb_deregister(&cypress_driver); - usb_serial_deregister(&cypress_earthmate_device); - usb_serial_deregister(&cypress_hidcom_device); - usb_serial_deregister(&cypress_ca42v2_device); + usb_serial_deregister_drivers(&cypress_driver, serial_drivers); } |