summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-03-16 17:13:55 +0100
committerJohan Hovold <johan@kernel.org>2017-03-28 11:14:12 +0200
commit6b0464c9d76bb6a3b192f6d518f7e5f510af72e8 (patch)
treefc2524469d07cc5a8255514cd3623fe98748d6b8 /drivers/usb/serial
parentbc4c2c15cbfc3747d0c14f547beb5d46cbe43641 (diff)
downloadlinux-6b0464c9d76bb6a3b192f6d518f7e5f510af72e8.tar.gz
linux-6b0464c9d76bb6a3b192f6d518f7e5f510af72e8.tar.bz2
linux-6b0464c9d76bb6a3b192f6d518f7e5f510af72e8.zip
USB: serial: mxuport: add endpoint sanity check
Add an explicit sanity check to make sure we have the expected endpoints. This will provide a descriptive error message in case an expected endpoint is missing when probing. Note that the driver already gracefully fails to probe (albeit with a less descriptive error message) if a bulk-in endpoint is missing, and an attempt to write to a port whose device lack a bulk-out endpoint would fail with -ENODEV. Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/mxuport.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/serial/mxuport.c b/drivers/usb/serial/mxuport.c
index 3355737cbfd1..34142feffd4d 100644
--- a/drivers/usb/serial/mxuport.c
+++ b/drivers/usb/serial/mxuport.c
@@ -1373,6 +1373,8 @@ static struct usb_serial_driver mxuport_device = {
},
.description = "MOXA UPort",
.id_table = mxuport_idtable,
+ .num_bulk_in = 2,
+ .num_bulk_out = 1,
.probe = mxuport_probe,
.port_probe = mxuport_port_probe,
.attach = mxuport_attach,