Skip to content

Commit 97c7ed8

Browse files
jwrdegoedeVudentz
authored andcommitted
Bluetooth: 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_FULL when HCI_UP is set in this case). 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]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 52bc7d6 commit 97c7ed8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/bluetooth/leds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static int power_activate(struct led_classdev *led_cdev)
4848
htrig = to_hci_basic_led_trigger(led_cdev->trigger);
4949
powered = test_bit(HCI_UP, &htrig->hdev->flags);
5050

51-
led_trigger_event(led_cdev->trigger, powered ? LED_FULL : LED_OFF);
51+
led_set_brightness(led_cdev, powered ? LED_FULL : LED_OFF);
5252

5353
return 0;
5454
}

0 commit comments

Comments
 (0)