diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-02-23 14:56:32 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-24 12:39:18 -0800 |
commit | 97b6b6d2339f67eb17d954930a908b762af66228 (patch) | |
tree | 955eb92c831f444e26a930b3cd301393bb7112a0 /drivers/usb/serial/ftdi_sio.c | |
parent | 08a4f6bc2e7046ce50849d7589b7d0763926d808 (diff) | |
download | lwn-97b6b6d2339f67eb17d954930a908b762af66228.tar.gz lwn-97b6b6d2339f67eb17d954930a908b762af66228.zip |
usb-serial: use new registration API in [d-h]* drivers
This patch (as1524) modifies the following usb-serial drivers to
utilize the new usb_serial_{de}register_drivers() routines:
digi_acceleport, empeg, ftdi_sio, funsoft, garmin_gps,
and hp4x.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/ftdi_sio.c')
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index f770415305f8..615cf2c4915c 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -857,7 +857,6 @@ static struct usb_driver ftdi_driver = { .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table_combined, - .no_dynamic_id = 1, }; static const char *ftdi_chip_name[] = { @@ -915,7 +914,6 @@ static struct usb_serial_driver ftdi_sio_device = { .name = "ftdi_sio", }, .description = "FTDI USB Serial Device", - .usb_driver = &ftdi_driver, .id_table = id_table_combined, .num_ports = 1, .bulk_in_size = 512, @@ -938,6 +936,10 @@ static struct usb_serial_driver ftdi_sio_device = { .break_ctl = ftdi_break_ctl, }; +static struct usb_serial_driver * const serial_drivers[] = { + &ftdi_sio_device, NULL +}; + #define WDR_TIMEOUT 5000 /* default urb timeout */ #define WDR_SHORT_TIMEOUT 1000 /* shorter urb timeout */ @@ -2420,19 +2422,10 @@ static int __init ftdi_init(void) id_table_combined[i].idVendor = vendor; id_table_combined[i].idProduct = product; } - retval = usb_serial_register(&ftdi_sio_device); - if (retval) - goto failed_sio_register; - retval = usb_register(&ftdi_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(&ftdi_sio_device); -failed_sio_register: + retval = usb_serial_register_drivers(&ftdi_driver, serial_drivers); + if (retval == 0) + printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" + DRIVER_DESC "\n"); return retval; } @@ -2440,8 +2433,7 @@ static void __exit ftdi_exit(void) { dbg("%s", __func__); - usb_deregister(&ftdi_driver); - usb_serial_deregister(&ftdi_sio_device); + usb_serial_deregister_drivers(&ftdi_driver, serial_drivers); } |