diff options
author | Johan Hovold <johan@kernel.org> | 2017-01-31 13:51:07 +0300 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2017-01-31 19:20:37 +0300 |
commit | 4481200364ab1d6820a77ed442775a6e4f7c979f (patch) | |
tree | 7af600527fc6295571bc86dc49f7c9350bca9c8a /drivers/usb | |
parent | ea534e0b404762894ac55ee416c0ac9f5cd5045a (diff) | |
download | linux-4481200364ab1d6820a77ed442775a6e4f7c979f.tar.xz |
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/serial/ark3116.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c index 754fc3e41005..d0fcff20ca7e 100644 --- a/drivers/usb/serial/ark3116.c +++ b/drivers/usb/serial/ark3116.c @@ -125,17 +125,11 @@ static inline int calc_divisor(int 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->dev->dev, - "%s - missing endpoint - " - "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; + 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; |