Skip to content

Commit

Permalink
HID: usbhid: no flushing if device is already polled
Browse files Browse the repository at this point in the history
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 <oneukum@suse.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
  • Loading branch information
Oliver Neukum authored and Jiri Kosina committed Jul 8, 2015
1 parent 67db8a8 commit 615322f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/hid/usbhid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 615322f

Please sign in to comment.