diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-02-23 19:57:25 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-24 20:39:20 (GMT) |
commit | d860322f34e4a53f347b1aeae23d5b72f1e91b8c (patch) | |
tree | bea8d4ab22b81eed98ab67c82a994b73cb6c5763 /drivers/usb/serial/spcp8x5.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/spcp8x5.c')
-rw-r--r-- | drivers/usb/serial/spcp8x5.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c index d7f5eee..af89893 100644 --- a/drivers/usb/serial/spcp8x5.c +++ b/drivers/usb/serial/spcp8x5.c @@ -156,7 +156,6 @@ static struct usb_driver spcp8x5_driver = { .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table, - .no_dynamic_id = 1, }; @@ -649,7 +648,6 @@ static struct usb_serial_driver spcp8x5_device = { .name = "SPCP8x5", }, .id_table = id_table, - .usb_driver = &spcp8x5_driver, .num_ports = 1, .open = spcp8x5_open, .dtr_rts = spcp8x5_dtr_rts, @@ -664,28 +662,24 @@ static struct usb_serial_driver spcp8x5_device = { .process_read_urb = spcp8x5_process_read_urb, }; +static struct usb_serial_driver * const serial_drivers[] = { + &spcp8x5_device, NULL +}; + static int __init spcp8x5_init(void) { int retval; - retval = usb_serial_register(&spcp8x5_device); - if (retval) - goto failed_usb_serial_register; - retval = usb_register(&spcp8x5_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(&spcp8x5_device); -failed_usb_serial_register: + + retval = usb_serial_register_drivers(&spcp8x5_driver, serial_drivers); + if (retval == 0) + printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" + DRIVER_DESC "\n"); return retval; } static void __exit spcp8x5_exit(void) { - usb_deregister(&spcp8x5_driver); - usb_serial_deregister(&spcp8x5_device); + usb_serial_deregister_drivers(&spcp8x5_driver, serial_drivers); } module_init(spcp8x5_init); |