summaryrefslogtreecommitdiff
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-10-12 10:54:22 +0200
committerJohan Hovold <johan@kernel.org>2017-10-13 09:45:09 +0200
commit6f792f471fad3ed16aca9ccedacdcd48fbedf7a9 (patch)
treed897cbba33bfbb1827627d56170d13b267b7ff6f /drivers/usb/serial
parent2339536d229df25c71c0900fc619289229bfecf6 (diff)
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/metro-usb.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/usb/serial/metro-usb.c b/drivers/usb/serial/metro-usb.c
index 4bb29e03dae4..a64940975ac6 100644
--- a/drivers/usb/serial/metro-usb.c
+++ b/drivers/usb/serial/metro-usb.c
@@ -160,13 +160,6 @@ static int metrousb_open(struct tty_struct *tty, struct usb_serial_port *port)
unsigned long flags = 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. */
spin_lock_irqsave(&metro_priv->lock, flags);
metro_priv->control_state = 0;
@@ -342,6 +335,7 @@ static struct usb_serial_driver metrousb_device = {
.description = "Metrologic USB to Serial",
.id_table = id_table,
.num_ports = 1,
+ .num_interrupt_in = 1,
.open = metrousb_open,
.close = metrousb_cleanup,
.read_int_callback = metrousb_read_int_callback,