From f667ddad41e303ebc2c6d5bf3105dffe2fbdd717 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Thu, 23 Feb 2012 14:57:18 -0500 Subject: usb-serial: use new registration API in [n-p]* drivers This patch (as1527) modifies the following usb-serial drivers to utilize the new usb_serial_{de}register_drivers() routines: navman, omninet, opticon, option, oti6858, and pl2303. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/oti6858.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'drivers/usb/serial/oti6858.c') diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c index 343e626a06f..53f2768c9a3 100644 --- a/drivers/usb/serial/oti6858.c +++ b/drivers/usb/serial/oti6858.c @@ -71,7 +71,6 @@ static struct usb_driver oti6858_driver = { .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table, - .no_dynamic_id = 1, }; static bool debug; @@ -157,7 +156,6 @@ static struct usb_serial_driver oti6858_device = { .name = "oti6858", }, .id_table = id_table, - .usb_driver = &oti6858_driver, .num_ports = 1, .open = oti6858_open, .close = oti6858_close, @@ -176,6 +174,10 @@ static struct usb_serial_driver oti6858_device = { .release = oti6858_release, }; +static struct usb_serial_driver * const serial_drivers[] = { + &oti6858_device, NULL +}; + struct oti6858_private { spinlock_t lock; @@ -960,21 +962,12 @@ static void oti6858_write_bulk_callback(struct urb *urb) static int __init oti6858_init(void) { - int retval; - - retval = usb_serial_register(&oti6858_device); - if (retval == 0) { - retval = usb_register(&oti6858_driver); - if (retval) - usb_serial_deregister(&oti6858_device); - } - return retval; + return usb_serial_register_drivers(&oti6858_driver, serial_drivers); } static void __exit oti6858_exit(void) { - usb_deregister(&oti6858_driver); - usb_serial_deregister(&oti6858_device); + usb_serial_deregister_drivers(&oti6858_driver, serial_drivers); } module_init(oti6858_init); -- cgit v1.2.3-18-g5258