]> git.baikalelectronics.ru Git - kernel.git/commit
Input: introduce managed input devices (add devres support)
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 3 Nov 2012 19:16:12 +0000 (12:16 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 8 Nov 2012 17:10:05 +0000 (09:10 -0800)
commit6b41556f851e134098c66226b2eebe1dd92a5712
tree34b24d6559118a4aedc60bdef265834530cacde9
parent3cb907d76d8902d7b560f861108a3bfca9cad772
Input: introduce managed input devices (add devres support)

There is a demand from driver's writers to use managed devices framework
for their drivers. Unfortunately up to this moment input devices did not
provide support for managed devices and that lead to mixing two styles
of resource management which usually introduced more bugs, such as
manually unregistering input device but relying in devres to free
interrupt handler which (unless device is properly shut off) can cause
ISR to reference already freed memory.

This change introduces devm_input_allocate_device() that will allocate
managed instance of input device so that driver writers who prefer
using devm_* framework do not have to mix 2 styles.

Reviewed-by: Henrik Rydberg <rydberg@euromail.se>
Reviewed-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/input.c
include/linux/input.h