summaryrefslogtreecommitdiff
path: root/drivers/usb/serial/option.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-02-23 14:57:18 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-24 12:39:20 -0800
commitf667ddad41e303ebc2c6d5bf3105dffe2fbdd717 (patch)
tree4f1391375183b38ef74bafed9a71f7f140c6c510 /drivers/usb/serial/option.c
parent4d2a7aff1062048ea59214b49ca1d915586d6d6d (diff)
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 <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/option.c')
-rw-r--r--drivers/usb/serial/option.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index b54afceb9611..138a7b98cda4 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -1212,7 +1212,6 @@ static struct usb_driver option_driver = {
.supports_autosuspend = 1,
#endif
.id_table = option_ids,
- .no_dynamic_id = 1,
};
/* The card has three separate interfaces, which the serial driver
@@ -1225,7 +1224,6 @@ static struct usb_serial_driver option_1port_device = {
.name = "option1",
},
.description = "GSM modem (1-port)",
- .usb_driver = &option_driver,
.id_table = option_ids,
.num_ports = 1,
.probe = option_probe,
@@ -1249,6 +1247,10 @@ static struct usb_serial_driver option_1port_device = {
#endif
};
+static struct usb_serial_driver * const serial_drivers[] = {
+ &option_1port_device, NULL
+};
+
static bool debug;
/* per port private data */
@@ -1284,28 +1286,17 @@ struct option_port_private {
static int __init option_init(void)
{
int retval;
- retval = usb_serial_register(&option_1port_device);
- if (retval)
- goto failed_1port_device_register;
- retval = usb_register(&option_driver);
- if (retval)
- goto failed_driver_register;
-
- printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
- DRIVER_DESC "\n");
-
- return 0;
-failed_driver_register:
- usb_serial_deregister(&option_1port_device);
-failed_1port_device_register:
+ retval = usb_serial_register_drivers(&option_driver, serial_drivers);
+ if (retval == 0)
+ printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
+ DRIVER_DESC "\n");
return retval;
}
static void __exit option_exit(void)
{
- usb_deregister(&option_driver);
- usb_serial_deregister(&option_1port_device);
+ usb_serial_deregister_drivers(&option_driver, serial_drivers);
}
module_init(option_init);