media: mceusb: fix control-message timeouts
authorJohan Hovold <johan@kernel.org>
Mon, 25 Oct 2021 12:16:34 +0000 (13:16 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 19 Nov 2021 06:03:51 +0000 (06:03 +0000)
USB control-message timeouts are specified in milliseconds and should
specifically not vary with CONFIG_HZ.

Fixes: 66e89522aff7 ("V4L/DVB: IR: add mceusb IR receiver driver")
Cc: stable@vger.kernel.org # 2.6.36
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/rc/mceusb.c

index d09bee8..2dc810f 100644 (file)
@@ -1430,7 +1430,7 @@ static void mceusb_gen1_init(struct mceusb_dev *ir)
         */
        ret = usb_control_msg(ir->usbdev, usb_rcvctrlpipe(ir->usbdev, 0),
                              USB_REQ_SET_ADDRESS, USB_TYPE_VENDOR, 0, 0,
-                             data, USB_CTRL_MSG_SZ, HZ * 3);
+                             data, USB_CTRL_MSG_SZ, 3000);
        dev_dbg(dev, "set address - ret = %d", ret);
        dev_dbg(dev, "set address - data[0] = %d, data[1] = %d",
                                                data[0], data[1]);
@@ -1438,20 +1438,20 @@ static void mceusb_gen1_init(struct mceusb_dev *ir)
        /* set feature: bit rate 38400 bps */
        ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
                              USB_REQ_SET_FEATURE, USB_TYPE_VENDOR,
-                             0xc04e, 0x0000, NULL, 0, HZ * 3);
+                             0xc04e, 0x0000, NULL, 0, 3000);
 
        dev_dbg(dev, "set feature - ret = %d", ret);
 
        /* bRequest 4: set char length to 8 bits */
        ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
                              4, USB_TYPE_VENDOR,
-                             0x0808, 0x0000, NULL, 0, HZ * 3);
+                             0x0808, 0x0000, NULL, 0, 3000);
        dev_dbg(dev, "set char length - retB = %d", ret);
 
        /* bRequest 2: set handshaking to use DTR/DSR */
        ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
                              2, USB_TYPE_VENDOR,
-                             0x0000, 0x0100, NULL, 0, HZ * 3);
+                             0x0000, 0x0100, NULL, 0, 3000);
        dev_dbg(dev, "set handshake  - retC = %d", ret);
 
        /* device resume */