Skip to content

Commit a1c91c1

Browse files
committed
USB: serial: ir-usb: simplify endpoint check
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Johan Hovold <[email protected]>
1 parent e7542bc commit a1c91c1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/usb/serial/ir-usb.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ static struct usb_serial_driver ir_device = {
7676
.description = "IR Dongle",
7777
.id_table = ir_id_table,
7878
.num_ports = 1,
79+
.num_bulk_in = 1,
80+
.num_bulk_out = 1,
7981
.set_termios = ir_set_termios,
8082
.attach = ir_startup,
8183
.write = ir_write,
@@ -197,9 +199,6 @@ static int ir_startup(struct usb_serial *serial)
197199
struct usb_irda_cs_descriptor *irda_desc;
198200
int rates;
199201

200-
if (serial->num_bulk_in < 1 || serial->num_bulk_out < 1)
201-
return -ENODEV;
202-
203202
irda_desc = irda_usb_find_class_desc(serial, 0);
204203
if (!irda_desc) {
205204
dev_err(&serial->dev->dev,

0 commit comments

Comments
 (0)