linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Johan Hovold <johan@kernel.org>
Cc: linux-usb@vger.kernel.org
Subject: [PATCH 5/5] USB: serial: ir-usb: simplify endpoint check
Date: Wed, 22 Jan 2020 11:15:30 +0100	[thread overview]
Message-ID: <20200122101530.29176-6-johan@kernel.org> (raw)
In-Reply-To: <20200122101530.29176-1-johan@kernel.org>

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(-)

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,
-- 
2.24.1


  parent reply	other threads:[~2020-01-22 10:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-22 10:15 [PATCH 0/5] USB: serial: ir-usb fixes and cleanups Johan Hovold
2020-01-22 10:15 ` [PATCH 1/5] USB: serial: ir-usb: add missing endpoint sanity check Johan Hovold
2020-01-22 13:25   ` Greg KH
2020-01-22 10:15 ` [PATCH 2/5] USB: serial: ir-usb: fix link-speed handling Johan Hovold
2020-01-22 13:24   ` Greg KH
2020-01-22 13:35     ` Johan Hovold
2020-01-22 10:15 ` [PATCH 3/5] USB: serial: ir-usb: fix IrLAP framing Johan Hovold
2020-01-22 13:25   ` Greg KH
2020-01-22 13:37     ` Johan Hovold
2020-01-22 10:15 ` [PATCH 4/5] USB: serial: ir-usb: make set_termios synchronous Johan Hovold
2020-01-22 13:26   ` Greg KH
2020-01-22 10:15 ` Johan Hovold [this message]
2020-01-22 13:26   ` [PATCH 5/5] USB: serial: ir-usb: simplify endpoint check Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200122101530.29176-6-johan@kernel.org \
    --to=johan@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).