mirror of https://gitee.com/openkylin/linux.git
usb-serial: use new registration API in staging drivers
This patch (as1530) modifies the following usb-serial drivers from drivers/staging to utilize the new usb_serial_{de}register_drivers() routines: quatech_usb2 and serqt_usb2. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
29618e9fb5
commit
69276a33bd
|
@ -135,7 +135,6 @@ static struct usb_driver quausb2_usb_driver = {
|
|||
.probe = usb_serial_probe,
|
||||
.disconnect = usb_serial_disconnect,
|
||||
.id_table = quausb2_id_table,
|
||||
.no_dynamic_id = 1,
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1942,7 +1941,6 @@ static struct usb_serial_driver quatech2_device = {
|
|||
.name = "quatech_usb2",
|
||||
},
|
||||
.description = DRIVER_DESC,
|
||||
.usb_driver = &quausb2_usb_driver,
|
||||
.id_table = quausb2_id_table,
|
||||
.num_ports = 8,
|
||||
.open = qt2_open,
|
||||
|
@ -1964,37 +1962,27 @@ static struct usb_serial_driver quatech2_device = {
|
|||
.write_bulk_callback = qt2_write_bulk_callback,
|
||||
};
|
||||
|
||||
static struct usb_serial_driver * const serial_drivers[] = {
|
||||
&quatech2_device, NULL
|
||||
};
|
||||
|
||||
static int __init quausb2_usb_init(void)
|
||||
{
|
||||
int retval;
|
||||
|
||||
dbg("%s\n", __func__);
|
||||
|
||||
/* register with usb-serial */
|
||||
retval = usb_serial_register(&quatech2_device);
|
||||
|
||||
if (retval)
|
||||
goto failed_usb_serial_register;
|
||||
|
||||
printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
|
||||
DRIVER_DESC "\n");
|
||||
|
||||
/* register with usb */
|
||||
|
||||
retval = usb_register(&quausb2_usb_driver);
|
||||
retval = usb_serial_register_drivers(&quausb2_usb_driver,
|
||||
serial_drivers);
|
||||
if (retval == 0)
|
||||
return 0;
|
||||
|
||||
/* if we're here, usb_register() failed */
|
||||
usb_serial_deregister(&quatech2_device);
|
||||
failed_usb_serial_register:
|
||||
return retval;
|
||||
printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
|
||||
DRIVER_DESC "\n");
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void __exit quausb2_usb_exit(void)
|
||||
{
|
||||
usb_deregister(&quausb2_usb_driver);
|
||||
usb_serial_deregister(&quatech2_device);
|
||||
usb_serial_deregister_drivers(&quausb2_usb_driver, serial_drivers);
|
||||
}
|
||||
|
||||
module_init(quausb2_usb_init);
|
||||
|
|
|
@ -200,7 +200,6 @@ static struct usb_driver serqt_usb_driver = {
|
|||
.probe = usb_serial_probe,
|
||||
.disconnect = usb_serial_disconnect,
|
||||
.id_table = serqt_id_table,
|
||||
.no_dynamic_id = 1,
|
||||
};
|
||||
|
||||
static int port_paranoia_check(struct usb_serial_port *port,
|
||||
|
@ -1590,7 +1589,6 @@ static struct usb_serial_driver quatech_device = {
|
|||
.name = "serqt",
|
||||
},
|
||||
.description = DRIVER_DESC,
|
||||
.usb_driver = &serqt_usb_driver,
|
||||
.id_table = serqt_id_table,
|
||||
.num_ports = 8,
|
||||
.open = qt_open,
|
||||
|
@ -1610,37 +1608,27 @@ static struct usb_serial_driver quatech_device = {
|
|||
.release = qt_release,
|
||||
};
|
||||
|
||||
static struct usb_serial_driver * const serial_drivers[] = {
|
||||
&quatech_device, NULL
|
||||
};
|
||||
|
||||
static int __init serqt_usb_init(void)
|
||||
{
|
||||
int retval;
|
||||
|
||||
dbg("%s\n", __func__);
|
||||
|
||||
/* register with usb-serial */
|
||||
retval = usb_serial_register(&quatech_device);
|
||||
|
||||
if (retval)
|
||||
goto failed_usb_serial_register;
|
||||
|
||||
printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
|
||||
DRIVER_DESC "\n");
|
||||
|
||||
/* register with usb */
|
||||
|
||||
retval = usb_register(&serqt_usb_driver);
|
||||
retval = usb_serial_register_drivers(&serqt_usb_driver,
|
||||
serial_drivers);
|
||||
if (retval == 0)
|
||||
return 0;
|
||||
|
||||
/* if we're here, usb_register() failed */
|
||||
usb_serial_deregister(&quatech_device);
|
||||
failed_usb_serial_register:
|
||||
printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
|
||||
DRIVER_DESC "\n");
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void __exit serqt_usb_exit(void)
|
||||
{
|
||||
usb_deregister(&serqt_usb_driver);
|
||||
usb_serial_deregister(&quatech_device);
|
||||
usb_serial_deregister_drivers(&serqt_usb_driver, serial_drivers);
|
||||
}
|
||||
|
||||
module_init(serqt_usb_init);
|
||||
|
|
Loading…
Reference in New Issue