Skip to content

Commit 80c4d3d

Browse files
jwrdegoedegregkh
authored andcommitted
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 <[email protected]> Reviewed-by: Jiri Slaby <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0bb17fd commit 80c4d3d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/tty/vt/keyboard.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,9 +1033,7 @@ static int kbd_led_trigger_activate(struct led_classdev *cdev)
10331033

10341034
tasklet_disable(&keyboard_tasklet);
10351035
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);
10391037
tasklet_enable(&keyboard_tasklet);
10401038

10411039
return 0;

0 commit comments

Comments
 (0)