Skip to content

Commit eb8dbe8

Browse files
committed
USB: serial: quatech2: fix control-request directions
The direction of the pipe argument must match the request-type direction bit or control requests may fail depending on the host-controller-driver implementation. Fix the three requests which erroneously used usb_rcvctrlpipe(). Fixes: f7a33e6 ("USB: serial: add quatech2 usb to serial driver") Cc: [email protected] # 3.5 Signed-off-by: Johan Hovold <[email protected]>
1 parent f8e8c1b commit eb8dbe8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/usb/serial/quatech2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ static void qt2_close(struct usb_serial_port *port)
416416

417417
/* flush the port transmit buffer */
418418
i = usb_control_msg(serial->dev,
419-
usb_rcvctrlpipe(serial->dev, 0),
419+
usb_sndctrlpipe(serial->dev, 0),
420420
QT2_FLUSH_DEVICE, 0x40, 1,
421421
port_priv->device_port, NULL, 0, QT2_USB_TIMEOUT);
422422

@@ -426,7 +426,7 @@ static void qt2_close(struct usb_serial_port *port)
426426

427427
/* flush the port receive buffer */
428428
i = usb_control_msg(serial->dev,
429-
usb_rcvctrlpipe(serial->dev, 0),
429+
usb_sndctrlpipe(serial->dev, 0),
430430
QT2_FLUSH_DEVICE, 0x40, 0,
431431
port_priv->device_port, NULL, 0, QT2_USB_TIMEOUT);
432432

@@ -639,7 +639,7 @@ static int qt2_attach(struct usb_serial *serial)
639639
int status;
640640

641641
/* power on unit */
642-
status = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
642+
status = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
643643
0xc2, 0x40, 0x8000, 0, NULL, 0,
644644
QT2_USB_TIMEOUT);
645645
if (status < 0) {

0 commit comments

Comments
 (0)