Skip to content

Commit 0407f1c

Browse files
committed
USB: serial: cp210x: return -EIO on short control transfers
Return -EIO on short control transfers rather than -EPROTO which is used for lower-level transfer errors. Signed-off-by: Johan Hovold <[email protected]>
1 parent c2b3355 commit 0407f1c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/usb/serial/cp210x.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ static int cp210x_read_reg_block(struct usb_serial_port *port, u8 req,
401401
dev_err(&port->dev, "failed get req 0x%x size %d status: %d\n",
402402
req, bufsize, result);
403403
if (result >= 0)
404-
result = -EPROTO;
404+
result = -EIO;
405405

406406
/*
407407
* 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,
514514
dev_err(&port->dev, "failed set req 0x%x size %d status: %d\n",
515515
req, bufsize, result);
516516
if (result >= 0)
517-
result = -EPROTO;
517+
result = -EIO;
518518
}
519519

520520
return result;
@@ -682,7 +682,7 @@ static int cp210x_get_tx_queue_byte_count(struct usb_serial_port *port,
682682
} else {
683683
dev_err(&port->dev, "failed to get comm status: %d\n", result);
684684
if (result >= 0)
685-
result = -EPROTO;
685+
result = -EIO;
686686
}
687687

688688
kfree(sts);

0 commit comments

Comments
 (0)