Skip to content

Commit 746e4ac

Browse files
jhovoldgregkh
authored andcommitted
USB: trancevibrator: fix control-request direction
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 set-speed request which erroneously used USB_DIR_IN and update the default timeout argument to match (same value). Fixes: 5638e4d ("USB: add PlayStation 2 Trance Vibrator driver") Cc: [email protected] # 2.6.19 Signed-off-by: Johan Hovold <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 6a4c8f6 commit 746e4ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/misc/trancevibrator.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ static ssize_t speed_store(struct device *dev, struct device_attribute *attr,
6161
/* Set speed */
6262
retval = usb_control_msg(tv->udev, usb_sndctrlpipe(tv->udev, 0),
6363
0x01, /* vendor request: set speed */
64-
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_OTHER,
64+
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_OTHER,
6565
tv->speed, /* speed value */
66-
0, NULL, 0, USB_CTRL_GET_TIMEOUT);
66+
0, NULL, 0, USB_CTRL_SET_TIMEOUT);
6767
if (retval) {
6868
tv->speed = old;
6969
dev_dbg(&tv->udev->dev, "retval = %d\n", retval);

0 commit comments

Comments
 (0)