Commit dc5338fc authored by Johan Hovold's avatar Johan Hovold

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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent 03f32d7c
...@@ -674,16 +674,13 @@ static int cp210x_write_reg_block(struct usb_serial_port *port, u8 req, ...@@ -674,16 +674,13 @@ static int cp210x_write_reg_block(struct usb_serial_port *port, u8 req,
kfree(dmabuf); kfree(dmabuf);
if (result == bufsize) { if (result < 0) {
result = 0;
} else {
dev_err(&port->dev, "failed set req 0x%x size %d status: %d\n", dev_err(&port->dev, "failed set req 0x%x size %d status: %d\n",
req, bufsize, result); req, bufsize, result);
if (result >= 0) return result;
result = -EIO;
} }
return result; return 0;
} }
/* /*
...@@ -720,17 +717,14 @@ static int cp210x_write_vendor_block(struct usb_serial *serial, u8 type, ...@@ -720,17 +717,14 @@ static int cp210x_write_vendor_block(struct usb_serial *serial, u8 type,
kfree(dmabuf); kfree(dmabuf);
if (result == bufsize) { if (result < 0) {
result = 0;
} else {
dev_err(&serial->interface->dev, dev_err(&serial->interface->dev,
"failed to set vendor val 0x%04x size %d: %d\n", val, "failed to set vendor val 0x%04x size %d: %d\n", val,
bufsize, result); bufsize, result);
if (result >= 0) return result;
result = -EIO;
} }
return result; return 0;
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment