From: Oliver Neukum <oneu...@suse.de>

During open() it is unnecessary to wait for the device to flush
stale inputs if the device is polled while closed due to a quirk
or opening fails.

Signed-off-by: Oliver Neukum <oneu...@suse.com>
---
 drivers/hid/usbhid/hid-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 63d1f0f..54dec35 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -710,7 +710,8 @@ int usbhid_open(struct hid_device *hid)
                 * Wait 50 msec for the queue to empty before allowing events
                 * to go through hid.
                 */
-               msleep(50);
+               if (res == 0 && !(hid->quirks & HID_QUIRK_ALWAYS_POLL))
+                       msleep(50);
                clear_bit(HID_RESUME_RUNNING, &usbhid->iofl);
        }
 done:
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to