]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
USB: serial: cp210x: return -EIO on short control transfers
authorJohan Hovold <johan@kernel.org>
Wed, 19 Oct 2016 13:46:39 +0000 (15:46 +0200)
committerJohan Hovold <johan@kernel.org>
Mon, 24 Oct 2016 10:00:19 +0000 (12:00 +0200)
Return -EIO on short control transfers rather than -EPROTO which is used
for lower-level transfer errors.

Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/cp210x.c

index 66e0950215121b4f9ffb83255d24e709b579bb13..f5ee4ba4b33bdc538001b999746b1dd95a284b2e 100644 (file)
@@ -401,7 +401,7 @@ static int cp210x_read_reg_block(struct usb_serial_port *port, u8 req,
                dev_err(&port->dev, "failed get req 0x%x size %d status: %d\n",
                                req, bufsize, result);
                if (result >= 0)
-                       result = -EPROTO;
+                       result = -EIO;
 
                /*
                 * FIXME Some callers don't bother to check for error,
@@ -514,7 +514,7 @@ static int cp210x_write_reg_block(struct usb_serial_port *port, u8 req,
                dev_err(&port->dev, "failed set req 0x%x size %d status: %d\n",
                                req, bufsize, result);
                if (result >= 0)
-                       result = -EPROTO;
+                       result = -EIO;
        }
 
        return result;
@@ -682,7 +682,7 @@ static int cp210x_get_tx_queue_byte_count(struct usb_serial_port *port,
        } else {
                dev_err(&port->dev, "failed to get comm status: %d\n", result);
                if (result >= 0)
-                       result = -EPROTO;
+                       result = -EIO;
        }
 
        kfree(sts);