Commit 6f792f47 authored by Johan Hovold's avatar Johan Hovold

USB: serial: metro-usb: simplify endpoint check

Let usb-serial core verify that the interrupt-in endpoint is present
when binding the interface instead of the driver verifying this at every
open.
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent 2339536d
...@@ -160,13 +160,6 @@ static int metrousb_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -160,13 +160,6 @@ static int metrousb_open(struct tty_struct *tty, struct usb_serial_port *port)
unsigned long flags = 0; unsigned long flags = 0;
int result = 0; int result = 0;
/* Make sure the urb is initialized. */
if (!port->interrupt_in_urb) {
dev_err(&port->dev, "%s - interrupt urb not initialized\n",
__func__);
return -ENODEV;
}
/* Set the private data information for the port. */ /* Set the private data information for the port. */
spin_lock_irqsave(&metro_priv->lock, flags); spin_lock_irqsave(&metro_priv->lock, flags);
metro_priv->control_state = 0; metro_priv->control_state = 0;
...@@ -342,6 +335,7 @@ static struct usb_serial_driver metrousb_device = { ...@@ -342,6 +335,7 @@ static struct usb_serial_driver metrousb_device = {
.description = "Metrologic USB to Serial", .description = "Metrologic USB to Serial",
.id_table = id_table, .id_table = id_table,
.num_ports = 1, .num_ports = 1,
.num_interrupt_in = 1,
.open = metrousb_open, .open = metrousb_open,
.close = metrousb_cleanup, .close = metrousb_cleanup,
.read_int_callback = metrousb_read_int_callback, .read_int_callback = metrousb_read_int_callback,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment