USB: serial: kobil_sct: add missing version error handling
Add missing version-request error handling and suppress printing of the (zeroed) transfer-buffer content in case of errors. Signed-off-by: Johan Hovold <johan@kernel.org>
This commit is contained in:
@@ -190,8 +190,10 @@ static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port)
|
|||||||
KOBIL_TIMEOUT
|
KOBIL_TIMEOUT
|
||||||
);
|
);
|
||||||
dev_dbg(dev, "%s - Send get_HW_version URB returns: %i\n", __func__, result);
|
dev_dbg(dev, "%s - Send get_HW_version URB returns: %i\n", __func__, result);
|
||||||
dev_dbg(dev, "Hardware version: %i.%i.%i\n", transfer_buffer[0],
|
if (result >= 3) {
|
||||||
transfer_buffer[1], transfer_buffer[2]);
|
dev_dbg(dev, "Hardware version: %i.%i.%i\n", transfer_buffer[0],
|
||||||
|
transfer_buffer[1], transfer_buffer[2]);
|
||||||
|
}
|
||||||
|
|
||||||
/* get firmware version */
|
/* get firmware version */
|
||||||
result = usb_control_msg(port->serial->dev,
|
result = usb_control_msg(port->serial->dev,
|
||||||
@@ -205,8 +207,10 @@ static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port)
|
|||||||
KOBIL_TIMEOUT
|
KOBIL_TIMEOUT
|
||||||
);
|
);
|
||||||
dev_dbg(dev, "%s - Send get_FW_version URB returns: %i\n", __func__, result);
|
dev_dbg(dev, "%s - Send get_FW_version URB returns: %i\n", __func__, result);
|
||||||
dev_dbg(dev, "Firmware version: %i.%i.%i\n", transfer_buffer[0],
|
if (result >= 3) {
|
||||||
transfer_buffer[1], transfer_buffer[2]);
|
dev_dbg(dev, "Firmware version: %i.%i.%i\n", transfer_buffer[0],
|
||||||
|
transfer_buffer[1], transfer_buffer[2]);
|
||||||
|
}
|
||||||
|
|
||||||
if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID ||
|
if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID ||
|
||||||
priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) {
|
priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) {
|
||||||
|
Reference in New Issue
Block a user