usb: gadget: f_hid: Use spinlock instead of mutex
authorKrzysztof Opasiak <kopasiak90@gmail.com>
Thu, 19 Jan 2017 17:55:29 +0000 (18:55 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 5 Jun 2017 20:13:44 +0000 (21:13 +0100)
commit7b1522cb280e76584d18527823b5398789f5a706
tree8a802734eb5dc540d8292d2f1bdd7d600a05dcf3
parent29c49277513d3d13a7c5a4f67fc34d3034c27826
usb: gadget: f_hid: Use spinlock instead of mutex

commit 33e4c1a9987a1fc3b42c3b534100b5b006d55c61 upstream.

As IN request has to be allocated in set_alt() and released in
disable() we cannot use mutex to protect it as we cannot sleep
in those funcitons. Let's replace this mutex with a spinlock.

Tested-by: David Lechner <david@lechnology.com>
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
[bwh: Backported to 3.2: adjust filename, context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/gadget/f_hid.c