diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-02-23 23:57:25 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-25 00:39:20 +0400 |
commit | d860322f34e4a53f347b1aeae23d5b72f1e91b8c (patch) | |
tree | bea8d4ab22b81eed98ab67c82a994b73cb6c5763 /drivers/usb/serial/safe_serial.c | |
parent | f667ddad41e303ebc2c6d5bf3105dffe2fbdd717 (diff) | |
download | linux-d860322f34e4a53f347b1aeae23d5b72f1e91b8c.tar.xz |
usb-serial: use new registration API in [q-s]* drivers
This patch (as1528) modifies the following usb-serial drivers to
utilize the new usb_serial_{de}register_drivers() routines:
qcaux, qcserial, safe_serial, siemens_mpi, sierra,
spcp8x5, ssu100, and symbolserial.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/safe_serial.c')
-rw-r--r-- | drivers/usb/serial/safe_serial.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/drivers/usb/serial/safe_serial.c b/drivers/usb/serial/safe_serial.c index d074b3740dcb..ae4ee30c7411 100644 --- a/drivers/usb/serial/safe_serial.c +++ b/drivers/usb/serial/safe_serial.c @@ -156,7 +156,6 @@ static struct usb_driver safe_driver = { .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table, - .no_dynamic_id = 1, }; static const __u16 crc10_table[256] = { @@ -309,16 +308,19 @@ static struct usb_serial_driver safe_device = { .name = "safe_serial", }, .id_table = id_table, - .usb_driver = &safe_driver, .num_ports = 1, .process_read_urb = safe_process_read_urb, .prepare_write_buffer = safe_prepare_write_buffer, .attach = safe_startup, }; +static struct usb_serial_driver * const serial_drivers[] = { + &safe_device, NULL +}; + static int __init safe_init(void) { - int i, retval; + int i; printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" DRIVER_DESC "\n"); @@ -337,24 +339,12 @@ static int __init safe_init(void) } } - retval = usb_serial_register(&safe_device); - if (retval) - goto failed_usb_serial_register; - retval = usb_register(&safe_driver); - if (retval) - goto failed_usb_register; - - return 0; -failed_usb_register: - usb_serial_deregister(&safe_device); -failed_usb_serial_register: - return retval; + return usb_serial_register_drivers(&safe_driver, serial_drivers); } static void __exit safe_exit(void) { - usb_deregister(&safe_driver); - usb_serial_deregister(&safe_device); + usb_serial_deregister_drivers(&safe_driver, serial_drivers); } module_init(safe_init); |