All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: linux-usb@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Johan Hovold <johan@kernel.org>
Subject: [PATCH 5/6] USB: serial: f81232: drop short control-transfer checks
Date: Mon, 18 Jan 2021 12:14:25 +0100	[thread overview]
Message-ID: <20210118111426.5147-6-johan@kernel.org> (raw)
In-Reply-To: <20210118111426.5147-1-johan@kernel.org>

There's no need to check for short control transfers when sending data
so remove the redundant sanity checks.

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

diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c
index 0c7eacc630e0..6a8f39147d8e 100644
--- a/drivers/usb/serial/f81232.c
+++ b/drivers/usb/serial/f81232.c
@@ -192,13 +192,9 @@ static int f81232_set_register(struct usb_serial_port *port, u16 reg, u8 val)
 				tmp,
 				sizeof(val),
 				USB_CTRL_SET_TIMEOUT);
-	if (status != sizeof(val)) {
+	if (status < 0) {
 		dev_err(&port->dev, "%s failed status: %d\n", __func__, status);
-
-		if (status < 0)
-			status = usb_translate_errors(status);
-		else
-			status = -EIO;
+		status = usb_translate_errors(status);
 	} else {
 		status = 0;
 	}
@@ -886,10 +882,6 @@ static int f81534a_ctrl_set_register(struct usb_interface *intf, u16 reg,
 			status = usb_translate_errors(status);
 			if (status == -EIO)
 				continue;
-		} else if (status != size) {
-			/* Retry on short transfers */
-			status = -EIO;
-			continue;
 		} else {
 			status = 0;
 		}
-- 
2.26.2


  parent reply	other threads:[~2021-01-18 11:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-18 11:14 [PATCH 0/6] USB: serial: drop short control-transfer checks Johan Hovold
2021-01-18 11:14 ` [PATCH 1/6] USB: serial: mxuport: drop short control-transfer check Johan Hovold
2021-01-18 11:14 ` [PATCH 2/6] USB: serial: upd78f0730: " Johan Hovold
2021-01-18 11:14 ` [PATCH 3/6] USB: serial: io_ti: " Johan Hovold
2021-01-18 11:14 ` [PATCH 4/6] USB: serial: io_ti: fix a debug-message copy-paste error Johan Hovold
2021-01-18 11:14 ` Johan Hovold [this message]
2021-01-18 11:14 ` [PATCH 6/6] USB: serial: f81534: drop short control-transfer check Johan Hovold
2021-01-18 11:23 ` [PATCH 0/6] USB: serial: drop short control-transfer checks Johan Hovold
2021-01-18 12:46 ` Greg Kroah-Hartman
2021-01-18 13:36   ` Johan Hovold

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=20210118111426.5147-6-johan@kernel.org \
    --to=johan@kernel.org \
    --cc=gregkh@linuxfoundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.