diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2016-01-25 20:46:21 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2016-02-23 20:29:36 +0100 |
commit | b6e402fc84a76c0238b64de497920aeeaa495026 (patch) | |
tree | b6ade31ae4948d2b9a9a8e615ba76a2a9a608128 /net/bluetooth/leds.c | |
parent | d2ee9c2ec659cfab715568d2d9837f7ff67402fa (diff) | |
download | lwn-b6e402fc84a76c0238b64de497920aeeaa495026.tar.gz lwn-b6e402fc84a76c0238b64de497920aeeaa495026.zip |
Bluetooth: Use managed version of led_trigger_register in LED trigger
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>
Diffstat (limited to 'net/bluetooth/leds.c')
-rw-r--r-- | net/bluetooth/leds.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/net/bluetooth/leds.c b/net/bluetooth/leds.c index ded7c88eaccc..8319c8440c89 100644 --- a/net/bluetooth/leds.c +++ b/net/bluetooth/leds.c @@ -55,7 +55,7 @@ static struct led_trigger *led_allocate_basic(struct hci_dev *hdev, 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; @@ -72,9 +72,3 @@ void hci_leds_init(struct hci_dev *hdev) /* 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); -} |