diff options
author | Johan Hovold <johan@kernel.org> | 2021-01-18 12:14:25 +0100 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2021-01-18 14:26:46 +0100 |
commit | 18d8fe614fad9e82ad45b6984f8c6cf733d38bc3 (patch) | |
tree | 01cd9ca0b083cb08fa5a0172458a83e72fd5fafc /drivers/usb | |
parent | 0765590f91a2b88dc3b946b954c47f774a051636 (diff) | |
download | linux-18d8fe614fad9e82ad45b6984f8c6cf733d38bc3.tar.bz2 |
USB: serial: f81232: drop short control-transfer checks
There's no need to check for short control transfers when sending data
so remove the redundant sanity checks.
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/serial/f81232.c | 12 |
1 files 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; } |