提交 11a4f400 编写于 作者: G Greg Kroah-Hartman

USB: serial: metro-usb: fix up usb_serial_register calls

The usb serial core has changed how the driver is to be registered and
unregistered recently.  Make these changes to the driver so that it will
properly build and work.

Cc: Aleksey Babahin <tamerlan311@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 43d186fe
...@@ -92,7 +92,6 @@ static struct usb_serial_driver metrousb_device = { ...@@ -92,7 +92,6 @@ static struct usb_serial_driver metrousb_device = {
}, },
.description = "Metrologic USB to serial converter.", .description = "Metrologic USB to serial converter.",
.id_table = id_table, .id_table = id_table,
.usb_driver = &metrousb_driver,
.num_ports = 1, .num_ports = 1,
.open = metrousb_open, .open = metrousb_open,
.close = metrousb_close, .close = metrousb_close,
...@@ -105,6 +104,11 @@ static struct usb_serial_driver metrousb_device = { ...@@ -105,6 +104,11 @@ static struct usb_serial_driver metrousb_device = {
.tiocmset = metrousb_tiocmset, .tiocmset = metrousb_tiocmset,
}; };
static struct usb_serial_driver * const serial_drivers[] = {
&metrousb_device,
NULL,
};
/* ---------------------------------------------------------------------------------------------- /* ----------------------------------------------------------------------------------------------
Description: Description:
Clean up any urbs and port information. Clean up any urbs and port information.
...@@ -163,10 +167,7 @@ static void metrousb_close (struct usb_serial_port *port) ...@@ -163,10 +167,7 @@ static void metrousb_close (struct usb_serial_port *port)
*/ */
static void __exit metrousb_exit(void) static void __exit metrousb_exit(void)
{ {
dbg("METRO-USB - %s", __FUNCTION__); usb_serial_deregister_drivers(&metrousb_driver, serial_drivers);
usb_deregister(&metrousb_driver);
usb_serial_deregister(&metrousb_device);
} }
/* ---------------------------------------------------------------------------------------------- /* ----------------------------------------------------------------------------------------------
...@@ -203,15 +204,10 @@ static int __init metrousb_init(void) ...@@ -203,15 +204,10 @@ static int __init metrousb_init(void)
} }
/* Register the devices. */ /* Register the devices. */
retval = usb_serial_register(&metrousb_device); retval = usb_serial_register_drivers(&metrousb_driver, serial_drivers);
if (retval) if (retval)
return retval; return retval;
/* Register the driver. */
retval = usb_register(&metrousb_driver);
if (retval)
usb_serial_deregister(&metrousb_device);
printk(KERN_INFO DRIVER_DESC " : " DRIVER_VERSION); printk(KERN_INFO DRIVER_DESC " : " DRIVER_VERSION);
return retval; return retval;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册