Skip to content

Commit

Permalink
USB: serial: mxuport: add endpoint sanity check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Hovold committed Mar 28, 2017
1 parent bc4c2c1 commit 6b0464c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/serial/mxuport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6b0464c

Please sign in to comment.