USB: serial: upd78f0730: drop short control-transfer check
authorJohan Hovold <johan@kernel.org>
Mon, 18 Jan 2021 11:14:22 +0000 (12:14 +0100)
committerJohan Hovold <johan@kernel.org>
Mon, 18 Jan 2021 13:26:32 +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/upd78f0730.c

index 0a2268c..1ca9c18 100644 (file)
@@ -145,14 +145,11 @@ static int upd78f0730_send_ctl(struct usb_serial_port *port,
 
        kfree(buf);
 
-       if (res != size) {
+       if (res < 0) {
                struct device *dev = &port->dev;
 
                dev_err(dev, "failed to send control request %02x: %d\n",
                        *(u8 *)data, res);
-               /* The maximum expected length of a transfer is 6 bytes */
-               if (res >= 0)
-                       res = -EIO;
 
                return res;
        }