HID: cp2112: prevent sleeping function called from invalid context
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Mon, 12 Aug 2019 16:04:44 +0000 (18:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Sep 2019 09:33:49 +0000 (10:33 +0100)
commit05d611c4ffb71db4206830a6d8d31c906937af88
tree53a8a3b964e0cf2c374c77f3bd93c252e8b53d72
parent5e1d50a3eafeaf2f1c3040d8a59e50a56bda0346
HID: cp2112: prevent sleeping function called from invalid context

[ Upstream commit 2d05dba2b25ecb0f8fc3a0b4eb2232da6454a47b ]

When calling request_threaded_irq() with a CP2112, the function
cp2112_gpio_irq_startup() is called in a IRQ context.

Therefore we can not sleep, and we can not call
cp2112_gpio_direction_input() there.

Move the call to cp2112_gpio_direction_input() earlier to have a working
driver.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-cp2112.c