summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2024-08-27 12:52:48 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2024-09-10 13:06:11 -0400
commit97c7ed86322440131f834d34c6670d1d472901dd (patch)
tree46e1dcc0e1f499320e6072fcfaa8ed621bf7ef28 /net
parent52bc7d66659faac6e5a47e3ab38d8c8f590e94e5 (diff)
downloadlwn-97c7ed86322440131f834d34c6670d1d472901dd.tar.gz
lwn-97c7ed86322440131f834d34c6670d1d472901dd.zip
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 <hdegoede@redhat.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/leds.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/leds.c b/net/bluetooth/leds.c
index f46847632ffa..6e349704efe4 100644
--- a/net/bluetooth/leds.c
+++ b/net/bluetooth/leds.c
@@ -48,7 +48,7 @@ static int power_activate(struct led_classdev *led_cdev)
htrig = to_hci_basic_led_trigger(led_cdev->trigger);
powered = test_bit(HCI_UP, &htrig->hdev->flags);
- led_trigger_event(led_cdev->trigger, powered ? LED_FULL : LED_OFF);
+ led_set_brightness(led_cdev, powered ? LED_FULL : LED_OFF);
return 0;
}