summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/io_edgeport.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-03-02 12:51:23 +0100
committerJohan Hovold <johan@kernel.org>2017-03-16 10:33:43 +0100
commitfd0c883e597493d85d0800629798fc6fcce8e24e (patch)
tree9c0274cdac2dc15942fa32ceee3421bc3d4f37a2 /drivers/usb/serial/io_edgeport.c
parente7d6507e5ba7aa015b454f4871d4dec1e751d3ce (diff)
downloadlinux-fd0c883e597493d85d0800629798fc6fcce8e24e.tar.bz2
USB: serial: io_edgeport: simplify and tighten endpoint check
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Also require the presence of a bulk-out endpoint, something which prevents the driver from trying to send bulk messages over the control pipe should a bulk-out endpoint be missing. Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial/io_edgeport.c')
-rw-r--r--drivers/usb/serial/io_edgeport.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index bb7673e80a57..751e7454c37b 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -2848,11 +2848,6 @@ static int edge_startup(struct usb_serial *serial)
EDGE_COMPATIBILITY_MASK1,
EDGE_COMPATIBILITY_MASK2 };
- if (serial->num_bulk_in < 1 || serial->num_interrupt_in < 1) {
- dev_err(&serial->interface->dev, "missing endpoints\n");
- return -ENODEV;
- }
-
dev = serial->dev;
/* create our private serial structure */
@@ -3120,6 +3115,9 @@ static struct usb_serial_driver edgeport_2port_device = {
.description = "Edgeport 2 port adapter",
.id_table = edgeport_2port_id_table,
.num_ports = 2,
+ .num_bulk_in = 1,
+ .num_bulk_out = 1,
+ .num_interrupt_in = 1,
.open = edge_open,
.close = edge_close,
.throttle = edge_throttle,
@@ -3152,6 +3150,9 @@ static struct usb_serial_driver edgeport_4port_device = {
.description = "Edgeport 4 port adapter",
.id_table = edgeport_4port_id_table,
.num_ports = 4,
+ .num_bulk_in = 1,
+ .num_bulk_out = 1,
+ .num_interrupt_in = 1,
.open = edge_open,
.close = edge_close,
.throttle = edge_throttle,
@@ -3184,6 +3185,9 @@ static struct usb_serial_driver edgeport_8port_device = {
.description = "Edgeport 8 port adapter",
.id_table = edgeport_8port_id_table,
.num_ports = 8,
+ .num_bulk_in = 1,
+ .num_bulk_out = 1,
+ .num_interrupt_in = 1,
.open = edge_open,
.close = edge_close,
.throttle = edge_throttle,
@@ -3216,6 +3220,9 @@ static struct usb_serial_driver epic_device = {
.description = "EPiC device",
.id_table = Epic_port_id_table,
.num_ports = 1,
+ .num_bulk_in = 1,
+ .num_bulk_out = 1,
+ .num_interrupt_in = 1,
.open = edge_open,
.close = edge_close,
.throttle = edge_throttle,