USB: serial: f81534: drop short control-transfer check
authorJohan Hovold <johan@kernel.org>
Mon, 18 Jan 2021 11:14:26 +0000 (12:14 +0100)
committerJohan Hovold <johan@kernel.org>
Mon, 18 Jan 2021 13:26:50 +0000 (14:26 +0100)
There's no need to check for short control transfers when sending data
so remove the redundant sanity check.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/f81534.c

index 5661fd0..dd7e55e 100644 (file)
@@ -235,11 +235,9 @@ static int f81534_set_register(struct usb_serial *serial, u16 reg, u8 data)
                                         USB_TYPE_VENDOR | USB_DIR_OUT,
                                         reg, 0, tmp, sizeof(u8),
                                         F81534_USB_TIMEOUT);
-               if (status > 0) {
+               if (status == sizeof(u8)) {
                        status = 0;
                        break;
-               } else if (status == 0) {
-                       status = -EIO;
                }
        }