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>
This commit is contained in:
Alan Stern
2012-02-23 14:57:18 -05:00
committed by Greg Kroah-Hartman
parent 4d2a7aff10
commit f667ddad41
6 changed files with 45 additions and 88 deletions

View File

@@ -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);