USB: serial: symbolserial: simplify endpoint check
authorJohan Hovold <johan@kernel.org>
Thu, 2 Mar 2017 11:51:33 +0000 (12:51 +0100)
committerJohan Hovold <johan@kernel.org>
Thu, 16 Mar 2017 09:33:47 +0000 (10:33 +0100)
Simplify the endpoint sanity check by letting core verify that the
required endpoints are present.

Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/symbolserial.c

index 37f3ad15ed06a5f6c1cf9db54ca0beef801d523f..0d1727232d0c1b2168804a557a71a24c2dcce247 100644 (file)
@@ -147,16 +147,6 @@ static void symbol_unthrottle(struct tty_struct *tty)
        }
 }
 
-static int symbol_startup(struct usb_serial *serial)
-{
-       if (!serial->num_interrupt_in) {
-               dev_err(&serial->dev->dev, "no interrupt-in endpoint\n");
-               return -ENODEV;
-       }
-
-       return 0;
-}
-
 static int symbol_port_probe(struct usb_serial_port *port)
 {
        struct symbol_private *priv;
@@ -188,7 +178,7 @@ static struct usb_serial_driver symbol_device = {
        },
        .id_table =             id_table,
        .num_ports =            1,
-       .attach =               symbol_startup,
+       .num_interrupt_in =     1,
        .port_probe =           symbol_port_probe,
        .port_remove =          symbol_port_remove,
        .open =                 symbol_open,