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/mct_u232.c | |
parent | 7dbe2460989b10644651e779b17b683627feea48 (diff) |
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/mct_u232.c')
-rw-r--r-- | drivers/usb/serial/mct_u232.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index 27fa9c8a77b..6d9a7f8b13d 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c @@ -88,7 +88,6 @@ static struct usb_driver mct_u232_driver = { .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table_combined, - .no_dynamic_id = 1, }; static struct usb_serial_driver mct_u232_device = { @@ -97,7 +96,6 @@ static struct usb_serial_driver mct_u232_device = { .name = "mct_u232", }, .description = "MCT U232", - .usb_driver = &mct_u232_driver, .id_table = id_table_combined, .num_ports = 1, .open = mct_u232_open, @@ -116,6 +114,10 @@ static struct usb_serial_driver mct_u232_device = { .get_icount = mct_u232_get_icount, }; +static struct usb_serial_driver * const serial_drivers[] = { + &mct_u232_device, NULL +}; + struct mct_u232_private { spinlock_t lock; unsigned int control_state; /* Modem Line Setting (TIOCM) */ @@ -907,26 +909,18 @@ static int mct_u232_get_icount(struct tty_struct *tty, static int __init mct_u232_init(void) { int retval; - retval = usb_serial_register(&mct_u232_device); - if (retval) - goto failed_usb_serial_register; - retval = usb_register(&mct_u232_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(&mct_u232_device); -failed_usb_serial_register: + + retval = usb_serial_register_drivers(&mct_u232_driver, serial_drivers); + if (retval == 0) + printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" + DRIVER_DESC "\n"); return retval; } static void __exit mct_u232_exit(void) { - usb_deregister(&mct_u232_driver); - usb_serial_deregister(&mct_u232_device); + usb_serial_deregister_drivers(&mct_u232_driver, serial_drivers); } module_init(mct_u232_init); |