diff options
author | Oliver Neukum <oneukum@suse.de> | 2015-06-29 05:10:41 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.com> | 2015-07-08 05:38:19 -0400 |
commit | 615322f6ac358f9c94b483d0a16f3f46fcb27b1c (patch) | |
tree | c386e8e1c1b942f65bd7081395e87792babe8b65 | |
parent | 67db8a8086e9b865533348954f5547f1e433101e (diff) |
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 <oneukum@suse.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
-rw-r--r-- | drivers/hid/usbhid/hid-core.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) | |||
710 | * Wait 50 msec for the queue to empty before allowing events | 710 | * Wait 50 msec for the queue to empty before allowing events |
711 | * to go through hid. | 711 | * to go through hid. |
712 | */ | 712 | */ |
713 | msleep(50); | 713 | if (res == 0 && !(hid->quirks & HID_QUIRK_ALWAYS_POLL)) |
714 | msleep(50); | ||
714 | clear_bit(HID_RESUME_RUNNING, &usbhid->iofl); | 715 | clear_bit(HID_RESUME_RUNNING, &usbhid->iofl); |
715 | } | 716 | } |
716 | done: | 717 | done: |