summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/generic.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-03-16 17:13:33 +0100
committerJohan Hovold <johan@kernel.org>2017-03-28 10:54:39 +0200
commit6538808c5619850cfedc9bee6d64d3793b31923d (patch)
tree9038717628370488ea2f6facc5f8391bf8ca2c64 /drivers/usb/serial/generic.c
parentUSB: serial: add calc_num_ports callback to generic driver (diff)
downloadlinux-6538808c5619850cfedc9bee6d64d3793b31923d.tar.xz
linux-6538808c5619850cfedc9bee6d64d3793b31923d.zip
USB: serial: relax generic driver bulk-endpoint requirement
Relax the generic driver bulk-endpoint requirement. The driver handles devices without bulk-out endpoints just fine these days. Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial/generic.c')
-rw-r--r--drivers/usb/serial/generic.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 2d3599f014e2..35cb8c0e584f 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -52,10 +52,12 @@ static int usb_serial_generic_calc_num_ports(struct usb_serial *serial,
struct usb_serial_endpoints *epds)
{
struct device *dev = &serial->interface->dev;
- int num_ports = epds->num_bulk_out;
+ int num_ports;
+
+ num_ports = max(epds->num_bulk_in, epds->num_bulk_out);
if (num_ports == 0) {
- dev_err(dev, "Generic device with no bulk out, not allowed.\n");
+ dev_err(dev, "device has no bulk endpoints\n");
return -ENODEV;
}