From: Johan Hovold Date: Thu, 16 Mar 2017 16:13:55 +0000 (+0100) Subject: USB: serial: mxuport: add endpoint sanity check X-Git-Tag: v4.14-rc1~993^2~9^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6b0464c9d76bb6a3b192f6d518f7e5f510af72e8;p=platform%2Fkernel%2Flinux-rpi.git 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 --- diff --git a/drivers/usb/serial/mxuport.c b/drivers/usb/serial/mxuport.c index 3355737..34142fe 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,