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>
This commit is contained in:
Johan Hovold 2021-01-18 12:13:29 +01:00
parent 03f32d7cb5
commit dc5338fc64
1 changed files with 6 additions and 12 deletions

View File

@ -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