Recently a managed version of led_trigger_register was introduced.
Using devm_led_trigger_register allows to simplify the LED trigger code.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
id = hdev->id;
- hci_leds_exit(hdev);
-
write_lock(&hci_dev_list_lock);
list_del(&hdev->list);
write_unlock(&hci_dev_list_lock);
if (!htrig->led_trigger.name)
goto err_alloc;
- if (led_trigger_register(&htrig->led_trigger))
+ if (devm_led_trigger_register(&hdev->dev, &htrig->led_trigger))
goto err_register;
return &htrig->led_trigger;
/* initialize power_led */
hdev->power_led = led_allocate_basic(hdev, power_activate, "power");
}
-
-void hci_leds_exit(struct hci_dev *hdev)
-{
- if (hdev->power_led)
- led_trigger_unregister(hdev->power_led);
-}
#if IS_ENABLED(CONFIG_BT_LEDS)
void hci_leds_update_powered(struct hci_dev *hdev, bool enabled);
void hci_leds_init(struct hci_dev *hdev);
-void hci_leds_exit(struct hci_dev *hdev);
#else
static inline void hci_leds_update_powered(struct hci_dev *hdev,
bool enabled) {}
static inline void hci_leds_init(struct hci_dev *hdev) {}
-static inline void hci_leds_exit(struct hci_dev *hdev) {}
#endif