]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: lenovo: Use brightness_set_blocking callback for setting LEDs brightness
authorHans de Goede <hdegoede@redhat.com>
Sun, 4 Apr 2021 08:04:24 +0000 (10:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 08:50:04 +0000 (10:50 +0200)
commite53e1fee4e8c4d71ec00a3241b78a8ce936d2063
tree53b9c97bc61826ab6637b1d0a9d178e5462cb573
parenta3a5f9c29384f3db076cd36b4fef2297a8284731
HID: lenovo: Use brightness_set_blocking callback for setting LEDs brightness

[ Upstream commit bbf62645255f120bc2e7488c237e3f04da42ec70 ]

The lenovo_led_brightness_set function may sleep, so we should have the
the led_class_dev's brightness_set_blocking callback point to it, rather
then the regular brightness_set callback.

When toggled through sysfs this is not a problem, but the brightness_set
callback may be called from atomic context when using LED-triggers.

Fixes: bc04b37ea0ec ("HID: lenovo: Add ThinkPad 10 Ultrabook Keyboard support")
Reviewed-by: Marek BehĂșn <kabel@kernel.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-lenovo.c