]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Input: cap11xx - switch to using set_brightness_blocking()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 5 Feb 2019 21:52:26 +0000 (13:52 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Mar 2019 13:35:12 +0000 (14:35 +0100)
commit0d523d6716da87ece0dce95e844d2e9674082b98
treed129e9add95aab02a3415083e222a3b96c2c8ee6
parentc7c2716139756fa0f8ac8d66146ed48fcf3e2259
Input: cap11xx - switch to using set_brightness_blocking()

[ Upstream commit 628442880af8c201d307a45f3862a7a17df8a189 ]

Updating LED state requires access to regmap and therefore we may sleep,
so we could not do that directly form set_brightness() method.
Historically we used private work to adjust the brightness, but with the
introduction of set_brightness_blocking() we no longer need it.

As a bonus, not having our own work item means we do not have
use-after-free issue as we neglected to cancel outstanding work on
driver unbind.

Reported-by: Sven Van Asbroeck <thesven73@gmail.com>
Reviewed-by: Sven Van Asbroeck <TheSven73@googlemail.com>
Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/input/keyboard/cap11xx.c