]> 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)
commitb1a0e324078b8da59da8c1b39ef882692faa7fd4
tree34b24d6559118a4aedc60bdef265834530cacde9
parentbae6cff374b622ada7297a2b255e408929b7ab17
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