diff options
author | Johan Hovold <johan@kernel.org> | 2017-03-02 12:51:20 +0100 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2017-03-16 10:33:42 +0100 |
commit | 52ccf4607a5581234fb5c5cff1d38a8c1b69fdc2 (patch) | |
tree | de41be639f3e1055c7bce6385ea8d4a3adc70c39 /drivers/usb/serial/ark3116.c | |
parent | USB: serial: add endpoint sanity check to core (diff) | |
download | linux-52ccf4607a5581234fb5c5cff1d38a8c1b69fdc2.tar.xz linux-52ccf4607a5581234fb5c5cff1d38a8c1b69fdc2.zip |
USB: serial: ark3116: simplify endpoint sanity check
Simplify the endpoint sanity check by letting core verify that the
required endpoints are present.
Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial/ark3116.c')
-rw-r--r-- | drivers/usb/serial/ark3116.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c index 2779e59c30f1..0adbd38b4eea 100644 --- a/drivers/usb/serial/ark3116.c +++ b/drivers/usb/serial/ark3116.c @@ -122,19 +122,6 @@ static inline int calc_divisor(int bps) return (12000000 + 2*bps) / (4*bps); } -static int ark3116_attach(struct usb_serial *serial) -{ - /* make sure we have our end-points */ - if (serial->num_bulk_in == 0 || - serial->num_bulk_out == 0 || - serial->num_interrupt_in == 0) { - dev_err(&serial->interface->dev, "missing endpoint\n"); - return -ENODEV; - } - - return 0; -} - static int ark3116_port_probe(struct usb_serial_port *port) { struct usb_serial *serial = port->serial; @@ -671,7 +658,9 @@ static struct usb_serial_driver ark3116_device = { }, .id_table = id_table, .num_ports = 1, - .attach = ark3116_attach, + .num_bulk_in = 1, + .num_bulk_out = 1, + .num_interrupt_in = 1, .port_probe = ark3116_port_probe, .port_remove = ark3116_port_remove, .set_termios = ark3116_set_termios, |