Skip to content

Commit

Permalink
USB: serial: cp210x: return -EIO on short control transfers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Hovold committed Oct 24, 2016
1 parent c2b3355 commit 0407f1c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/usb/serial/cp210x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 0407f1c

Please sign in to comment.