summaryrefslogtreecommitdiff
path: root/drivers/hid/uhid.c
diff options
context:
space:
mode:
authorHemant Gupta <hemantg@codeaurora.org>2017-01-17 15:55:16 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-17 07:56:23 -0800
commit24a389ae5faada917da4faa56471d66e3ee67011 (patch)
tree9ce1c90c041ff4ec937cf70c9f25ba6acdf178ae /drivers/hid/uhid.c
parent4b3736890b25b8af6a8468f13ef8a310c7468a92 (diff)
HID: uhid: Remove mutex_unlock while waiting
Because of recently introduced kernel change, previous change to unlock mutex is not required as HID device addition is now done in worker thread instead of main thread. Previous code flow was blocking as uhid_hid_set_report was called from main thread which is not the case now. Previous code flow was uhid_char_write->uhid_dev_create2->uhid_hid_raw_request-> uhid_hid_set_report->__uhid_report_queue_and_wait-> wait_event_interruptible_timeout which is now changed to uhid_char_write->uhid_dev_create2. CRs-Fixed: 1112380 Signed-off-by: Hemant Gupta <hemantg@codeaurora.org> Change-Id: I11c3e5628484739acc208deff84a82f34b1b7beb
Diffstat (limited to 'drivers/hid/uhid.c')
-rw-r--r--drivers/hid/uhid.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c
index 54dc4ce09f35..1a2032c2c1fb 100644
--- a/drivers/hid/uhid.c
+++ b/drivers/hid/uhid.c
@@ -175,27 +175,9 @@ static int __uhid_report_queue_and_wait(struct uhid_device *uhid,
uhid_queue(uhid, ev);
spin_unlock_irqrestore(&uhid->qlock, flags);
- /*
- * Assumption: report_lock and devlock are both locked. So unlock
- * before sleeping.
- */
- mutex_unlock(&uhid->report_lock);
- mutex_unlock(&uhid->devlock);
ret = wait_event_interruptible_timeout(uhid->report_wait,
!uhid->report_running || !uhid->running,
5 * HZ);
- ret = mutex_lock_interruptible(&uhid->devlock);
- if (ret)
- return ret;
- ret = mutex_lock_interruptible(&uhid->report_lock);
- if (ret) {
- /*
- * Failed to lock, unlock previous mutex before exiting
- * this function.
- */
- mutex_unlock(&uhid->devlock);
- return ret;
- }
if (!ret || !uhid->running || uhid->report_running)
ret = -EIO;
else if (ret < 0)