Commit 2d5733fc authored by Yuri Matylitski's avatar Yuri Matylitski Committed by Greg Kroah-Hartman

USB: serial: cp210x: Fixed usb_control_msg timeout values

Fixed too small hardcoded timeout values for usb_control_msg
in driver for SiliconLabs cp210x-based usb-to-serial adapters.
Replaced with USB_CTRL_GET_TIMEOUT/USB_CTRL_SET_TIMEOUT.
Signed-off-by: default avatarYuri Matylitski <ym@tekinsoft.com>
Acked-by: default avatarKirill A. Shutemov <kirill@shutemov.name>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8034761c
...@@ -287,7 +287,8 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request, ...@@ -287,7 +287,8 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request,
/* Issue the request, attempting to read 'size' bytes */ /* Issue the request, attempting to read 'size' bytes */
result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
request, REQTYPE_DEVICE_TO_HOST, 0x0000, request, REQTYPE_DEVICE_TO_HOST, 0x0000,
port_priv->bInterfaceNumber, buf, size, 300); port_priv->bInterfaceNumber, buf, size,
USB_CTRL_GET_TIMEOUT);
/* Convert data into an array of integers */ /* Convert data into an array of integers */
for (i = 0; i < length; i++) for (i = 0; i < length; i++)
...@@ -340,12 +341,14 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request, ...@@ -340,12 +341,14 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request,
result = usb_control_msg(serial->dev, result = usb_control_msg(serial->dev,
usb_sndctrlpipe(serial->dev, 0), usb_sndctrlpipe(serial->dev, 0),
request, REQTYPE_HOST_TO_DEVICE, 0x0000, request, REQTYPE_HOST_TO_DEVICE, 0x0000,
port_priv->bInterfaceNumber, buf, size, 300); port_priv->bInterfaceNumber, buf, size,
USB_CTRL_SET_TIMEOUT);
} else { } else {
result = usb_control_msg(serial->dev, result = usb_control_msg(serial->dev,
usb_sndctrlpipe(serial->dev, 0), usb_sndctrlpipe(serial->dev, 0),
request, REQTYPE_HOST_TO_DEVICE, data[0], request, REQTYPE_HOST_TO_DEVICE, data[0],
port_priv->bInterfaceNumber, NULL, 0, 300); port_priv->bInterfaceNumber, NULL, 0,
USB_CTRL_SET_TIMEOUT);
} }
kfree(buf); kfree(buf);
......
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