diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-02-23 14:57:09 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-24 12:39:19 -0800 |
commit | 4d2a7aff1062048ea59214b49ca1d915586d6d6d (patch) | |
tree | 42e5426b6bb4abeee669d2dd709fb1285836b043 /drivers/usb/serial/mos7840.c | |
parent | 7dbe2460989b10644651e779b17b683627feea48 (diff) | |
download | op-kernel-dev-4d2a7aff1062048ea59214b49ca1d915586d6d6d.zip op-kernel-dev-4d2a7aff1062048ea59214b49ca1d915586d6d6d.tar.gz |
usb-serial: use new registration API in [k-m]* drivers
This patch (as1526) modifies the following usb-serial drivers to
utilize the new usb_serial_{de}register_drivers() routines:
keyspan, kl5kusb105, kobil_sct, mct_u232, mos7720,
mos7840, and moto_modem.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/mos7840.c')
-rw-r--r-- | drivers/usb/serial/mos7840.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 19b11ce..b45522e 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c @@ -2638,7 +2638,6 @@ static struct usb_driver io_driver = { .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = moschip_id_table_combined, - .no_dynamic_id = 1, }; static struct usb_serial_driver moschip7840_4port_device = { @@ -2647,7 +2646,6 @@ static struct usb_serial_driver moschip7840_4port_device = { .name = "mos7840", }, .description = DRIVER_DESC, - .usb_driver = &io_driver, .id_table = moschip_port_id_table, .num_ports = 4, .open = mos7840_open, @@ -2674,6 +2672,10 @@ static struct usb_serial_driver moschip7840_4port_device = { .read_int_callback = mos7840_interrupt_callback, }; +static struct usb_serial_driver * const serial_drivers[] = { + &moschip7840_4port_device, NULL +}; + /**************************************************************************** * moschip7840_init * This is called by the module subsystem, or on startup to initialize us @@ -2684,24 +2686,12 @@ static int __init moschip7840_init(void) dbg("%s", " mos7840_init :entering.........."); - /* Register with the usb serial */ - retval = usb_serial_register(&moschip7840_4port_device); - - if (retval) - goto failed_port_device_register; - - dbg("%s", "Entering..."); - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" - DRIVER_DESC "\n"); + retval = usb_serial_register_drivers(&io_driver, serial_drivers); + if (retval == 0) + printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" + DRIVER_DESC "\n"); - /* Register with the usb */ - retval = usb_register(&io_driver); - if (retval == 0) { - dbg("%s", "Leaving..."); - return 0; - } - usb_serial_deregister(&moschip7840_4port_device); -failed_port_device_register: + dbg("%s", "Leaving..."); return retval; } @@ -2714,9 +2704,7 @@ static void __exit moschip7840_exit(void) dbg("%s", " mos7840_exit :entering.........."); - usb_deregister(&io_driver); - - usb_serial_deregister(&moschip7840_4port_device); + usb_serial_deregister_drivers(&io_driver, serial_drivers); dbg("%s", "Entering..."); } |