]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerJiri Kosina <jkosina@suse.cz>
Mon, 19 Aug 2019 12:13:00 +0000 (14:13 +0200)
commit2be418bb82fb0aebc96c2c0a758352ee8f661e9e
treedd6628d1bdd38a416ad038de0796404e02827c94
parent787f918452a7ac6e3369bd60c5ab620983751544
HID: cp2112: prevent sleeping function called from invalid context

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>
drivers/hid/hid-cp2112.c