Commit 52ccf460 authored by Johan Hovold's avatar Johan Hovold

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: default avatarJohan Hovold <johan@kernel.org>
parent 92e6b2c6
......@@ -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,
......
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