summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2021-01-18 12:13:29 +0100
committerJohan Hovold <johan@kernel.org>2021-01-18 14:24:59 +0100
commitdc5338fc64b23e37b000d1a29b88dc8209acebf9 (patch)
treea6bd1fcbfb22e70f3d7de2f035eb2a25dadfaba5 /drivers/usb
parent03f32d7cb51b62f6cc7fd884d6978fe1a6ad3f8d (diff)
downloadlinux-stable-dc5338fc64b23e37b000d1a29b88dc8209acebf9.tar.gz
linux-stable-dc5338fc64b23e37b000d1a29b88dc8209acebf9.tar.bz2
linux-stable-dc5338fc64b23e37b000d1a29b88dc8209acebf9.zip
USB: serial: cp210x: drop short control-transfer checks
There's no need to check for short control transfers when sending data so remove the redundant sanity checks. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/cp210x.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 4f90573c0d2b..360398665c17 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -674,16 +674,13 @@ static int cp210x_write_reg_block(struct usb_serial_port *port, u8 req,
kfree(dmabuf);
- if (result == bufsize) {
- result = 0;
- } else {
+ if (result < 0) {
dev_err(&port->dev, "failed set req 0x%x size %d status: %d\n",
req, bufsize, result);
- if (result >= 0)
- result = -EIO;
+ return result;
}
- return result;
+ return 0;
}
/*
@@ -720,17 +717,14 @@ static int cp210x_write_vendor_block(struct usb_serial *serial, u8 type,
kfree(dmabuf);
- if (result == bufsize) {
- result = 0;
- } else {
+ if (result < 0) {
dev_err(&serial->interface->dev,
"failed to set vendor val 0x%04x size %d: %d\n", val,
bufsize, result);
- if (result >= 0)
- result = -EIO;
+ return result;
}
- return result;
+ return 0;
}
#endif