Skip to content

Commit c48439f

Browse files
Zijun HuVudentz
authored andcommitted
Bluetooth: btusb: Correct timeout macro argument used to receive control message
USB driver defines macro @USB_CTRL_SET_TIMEOUT for sending control message timeout and @USB_CTRL_GET_TIMEOUT for receiving, but usb_control_msg() uses wrong macro @USB_CTRL_SET_TIMEOUT as argument to receive control message, fixed by using @USB_CTRL_GET_TIMEOUT to receive message. Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
1 parent 958cd6b commit c48439f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/bluetooth/btusb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2956,7 +2956,7 @@ static int btusb_mtk_uhw_reg_read(struct btusb_data *data, u32 reg, u32 *val)
29562956
err = usb_control_msg(data->udev, pipe, 0x01,
29572957
0xDE,
29582958
reg >> 16, reg & 0xffff,
2959-
buf, 4, USB_CTRL_SET_TIMEOUT);
2959+
buf, 4, USB_CTRL_GET_TIMEOUT);
29602960
if (err < 0) {
29612961
bt_dev_err(hdev, "Failed to read uhw reg(%d)", err);
29622962
goto err_free_buf;
@@ -2984,7 +2984,7 @@ static int btusb_mtk_reg_read(struct btusb_data *data, u32 reg, u32 *val)
29842984
err = usb_control_msg(data->udev, pipe, 0x63,
29852985
USB_TYPE_VENDOR | USB_DIR_IN,
29862986
reg >> 16, reg & 0xffff,
2987-
buf, size, USB_CTRL_SET_TIMEOUT);
2987+
buf, size, USB_CTRL_GET_TIMEOUT);
29882988
if (err < 0)
29892989
goto err_free_buf;
29902990

@@ -3699,7 +3699,7 @@ static int btusb_qca_send_vendor_req(struct usb_device *udev, u8 request,
36993699
*/
37003700
pipe = usb_rcvctrlpipe(udev, 0);
37013701
err = usb_control_msg(udev, pipe, request, USB_TYPE_VENDOR | USB_DIR_IN,
3702-
0, 0, buf, size, USB_CTRL_SET_TIMEOUT);
3702+
0, 0, buf, size, USB_CTRL_GET_TIMEOUT);
37033703
if (err < 0) {
37043704
dev_err(&udev->dev, "Failed to access otp area (%d)", err);
37053705
goto done;

0 commit comments

Comments
 (0)