提交 206ff831 编写于 作者: J Johan Hovold

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: NJohan Hovold <johan@kernel.org>
上级 35194572
...@@ -1900,11 +1900,6 @@ static int mos7720_startup(struct usb_serial *serial) ...@@ -1900,11 +1900,6 @@ static int mos7720_startup(struct usb_serial *serial)
u16 product; u16 product;
int ret_val; 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); product = le16_to_cpu(serial->dev->descriptor.idProduct);
dev = serial->dev; dev = serial->dev;
...@@ -2039,6 +2034,8 @@ static struct usb_serial_driver moschip7720_2port_driver = { ...@@ -2039,6 +2034,8 @@ static struct usb_serial_driver moschip7720_2port_driver = {
}, },
.description = "Moschip 2 port adapter", .description = "Moschip 2 port adapter",
.id_table = id_table, .id_table = id_table,
.num_bulk_in = 2,
.num_bulk_out = 2,
.calc_num_ports = mos77xx_calc_num_ports, .calc_num_ports = mos77xx_calc_num_ports,
.open = mos7720_open, .open = mos7720_open,
.close = mos7720_close, .close = mos7720_close,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册