diff mbox series

[5/5] USB: serial: ir-usb: simplify endpoint check

Message ID 20200122101530.29176-6-johan@kernel.org (mailing list archive)
State Mainlined
Commit a1c91c1036397f2f7074aa4f5df8a2412e94ab97
Headers show
Series USB: serial: ir-usb fixes and cleanups | expand

Commit Message

Johan Hovold Jan. 22, 2020, 10:15 a.m. UTC
Simplify the endpoint sanity check by letting core verify that the
required endpoints are present.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/usb/serial/ir-usb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Greg Kroah-Hartman Jan. 22, 2020, 1:26 p.m. UTC | #1
On Wed, Jan 22, 2020 at 11:15:30AM +0100, Johan Hovold wrote:
> Simplify the endpoint sanity check by letting core verify that the
> required endpoints are present.
> 
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
>  drivers/usb/serial/ir-usb.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff mbox series

Patch

diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
index 3cd70392e2a2..79d0586e2b33 100644
--- a/drivers/usb/serial/ir-usb.c
+++ b/drivers/usb/serial/ir-usb.c
@@ -76,6 +76,8 @@  static struct usb_serial_driver ir_device = {
 	.description		= "IR Dongle",
 	.id_table		= ir_id_table,
 	.num_ports		= 1,
+	.num_bulk_in		= 1,
+	.num_bulk_out		= 1,
 	.set_termios		= ir_set_termios,
 	.attach			= ir_startup,
 	.write			= ir_write,
@@ -197,9 +199,6 @@  static int ir_startup(struct usb_serial *serial)
 	struct usb_irda_cs_descriptor *irda_desc;
 	int rates;
 
-	if (serial->num_bulk_in < 1 || serial->num_bulk_out < 1)
-		return -ENODEV;
-
 	irda_desc = irda_usb_find_class_desc(serial, 0);
 	if (!irda_desc) {
 		dev_err(&serial->dev->dev,