Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

vt: keyboard: Use led_set_brightness() in LED trigger activate() callback

A LED trigger's activate() callback gets called when the LED trigger
gets activated for a specific LED, so that the trigger code can ensure
the LED state matches the current state of the trigger condition.

led_trigger_event() is intended for trigger condition state changes and
iterates over _all_ LEDs which are controlled by this trigger changing
the brightness of each of them.

In the activate() case only the brightness of the LED which is being
activated needs to change and that LED is passed as an argument to
activate(), switch to led_set_brightness() to only change the brightness
of the LED being activated.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20240511152030.4848-1-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Hans de Goede and committed by
Greg Kroah-Hartman
80c4d3d4 0bb17fdc

+1 -3
+1 -3
drivers/tty/vt/keyboard.c
··· 1033 1033 1034 1034 tasklet_disable(&keyboard_tasklet); 1035 1035 if (ledstate != -1U) 1036 - led_trigger_event(&trigger->trigger, 1037 - ledstate & trigger->mask ? 1038 - LED_FULL : LED_OFF); 1036 + led_set_brightness(cdev, ledstate & trigger->mask ? LED_FULL : LED_OFF); 1039 1037 tasklet_enable(&keyboard_tasklet); 1040 1038 1041 1039 return 0;