• Dmitry Torokhov's avatar
    Input: introduce managed input devices (add devres support) · 2be975c6
    Dmitry Torokhov authored
    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: default avatarHenrik Rydberg <rydberg@euromail.se>
    Reviewed-by: default avatarTejun Heo <tj@kernel.org>
    Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
    2be975c6
input.c 58 KB