]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
vt: keyboard: Use led_set_brightness() in LED trigger activate() callback
authorHans de Goede <hdegoede@redhat.com>
Sat, 11 May 2024 15:20:30 +0000 (17:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 Jun 2024 12:00:53 +0000 (14:00 +0200)
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>
drivers/tty/vt/keyboard.c

index a2116e135a82d48e353ea2857e8bafb9e2b0687e..804355da46f5a095d5e4d87306071e08dab1f66e 100644 (file)
@@ -1033,9 +1033,7 @@ static int kbd_led_trigger_activate(struct led_classdev *cdev)
 
        tasklet_disable(&keyboard_tasklet);
        if (ledstate != -1U)
-               led_trigger_event(&trigger->trigger,
-                                 ledstate & trigger->mask ?
-                                       LED_FULL : LED_OFF);
+               led_set_brightness(cdev, ledstate & trigger->mask ? LED_FULL : LED_OFF);
        tasklet_enable(&keyboard_tasklet);
 
        return 0;