From: Oliver Neukum Date: Mon, 29 Jun 2015 09:10:41 +0000 (+0200) Subject: HID: usbhid: no flushing if device is already polled X-Git-Tag: firefly_0821_release~176^2~1174^2~3^2~6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=615322f6ac358f9c94b483d0a16f3f46fcb27b1c;p=firefly-linux-kernel-4.4.55.git HID: usbhid: no flushing if device is already polled 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 Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index bfbe1bedda7f..1a23d78fe5e7 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: