summaryrefslogtreecommitdiff
path: root/drivers/usb/serial/mos7720.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-03-02 14:51:27 +0300
committerJohan Hovold <johan@kernel.org>2017-03-16 12:33:44 +0300
commit206ff831bebb816087da29a34fcff5bd603602e1 (patch)
tree37f09a7e82d27c72eed82857b50136db5e8f2373 /drivers/usb/serial/mos7720.c
parent35194572b4ede8b021d4c70c8785cd4d5c3fae0a (diff)
downloadlinux-206ff831bebb816087da29a34fcff5bd603602e1.tar.xz
USB: serial: mos7720: simplify endpoint check
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Note that the driver expects two bulk-endpoint pairs also for mcs7715 devices for which only one serial port is registered. Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial/mos7720.c')
-rw-r--r--drivers/usb/serial/mos7720.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index f075121c6e32..df45ebad5f6f 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -1900,11 +1900,6 @@ static int mos7720_startup(struct usb_serial *serial)
u16 product;
int ret_val;
- if (serial->num_bulk_in < 2 || serial->num_bulk_out < 2) {
- dev_err(&serial->interface->dev, "missing bulk endpoints\n");
- return -ENODEV;
- }
-
product = le16_to_cpu(serial->dev->descriptor.idProduct);
dev = serial->dev;
@@ -2039,6 +2034,8 @@ static struct usb_serial_driver moschip7720_2port_driver = {
},
.description = "Moschip 2 port adapter",
.id_table = id_table,
+ .num_bulk_in = 2,
+ .num_bulk_out = 2,
.calc_num_ports = mos77xx_calc_num_ports,
.open = mos7720_open,
.close = mos7720_close,