]> Pileus Git - ~andy/linux/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)
commit2be975c6d920de989ff5e4bc09ffe87e59d94662
tree34b24d6559118a4aedc60bdef265834530cacde9
parentfa8e2458ecfc959cd627e25ba86d8eddcb63c887
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