Commit 44812003 authored by Johan Hovold's avatar Johan Hovold

USB: serial: ark3116: fix endpoint-check return value

Return -ENODEV rather than -EINVAL on probe errors due to a missing
endpoint.

Also clean up the endpoint sanity check somewhat and use the interface
device for logging a more compact error in case an expected endpoint is
missing.
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent ea534e0b
...@@ -125,17 +125,11 @@ static inline int calc_divisor(int bps) ...@@ -125,17 +125,11 @@ static inline int calc_divisor(int bps)
static int ark3116_attach(struct usb_serial *serial) static int ark3116_attach(struct usb_serial *serial)
{ {
/* make sure we have our end-points */ /* make sure we have our end-points */
if ((serial->num_bulk_in == 0) || if (serial->num_bulk_in == 0 ||
(serial->num_bulk_out == 0) || serial->num_bulk_out == 0 ||
(serial->num_interrupt_in == 0)) { serial->num_interrupt_in == 0) {
dev_err(&serial->dev->dev, dev_err(&serial->interface->dev, "missing endpoint\n");
"%s - missing endpoint - " return -ENODEV;
"bulk in: %d, bulk out: %d, int in %d\n",
KBUILD_MODNAME,
serial->num_bulk_in,
serial->num_bulk_out,
serial->num_interrupt_in);
return -EINVAL;
} }
return 0; return 0;
......
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