leds.c (0cce284537fb42d9c28b9b31038ffc9b464555f5) leds.c (2282e125a406e09331c5a785e3df29035c99a607)
1/*
2 * Copyright 2015, Heiner Kallweit <hkallweit1@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8

--- 29 unchanged lines hidden (view full) ---

38 }
39
40 read_unlock(&hci_dev_list_lock);
41 }
42
43 led_trigger_event(bt_power_led_trigger, enabled ? LED_FULL : LED_OFF);
44}
45
1/*
2 * Copyright 2015, Heiner Kallweit <hkallweit1@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8

--- 29 unchanged lines hidden (view full) ---

38 }
39
40 read_unlock(&hci_dev_list_lock);
41 }
42
43 led_trigger_event(bt_power_led_trigger, enabled ? LED_FULL : LED_OFF);
44}
45
46static void power_activate(struct led_classdev *led_cdev)
46static int power_activate(struct led_classdev *led_cdev)
47{
48 struct hci_basic_led_trigger *htrig;
49 bool powered;
50
51 htrig = to_hci_basic_led_trigger(led_cdev->trigger);
52 powered = test_bit(HCI_UP, &htrig->hdev->flags);
53
54 led_trigger_event(led_cdev->trigger, powered ? LED_FULL : LED_OFF);
47{
48 struct hci_basic_led_trigger *htrig;
49 bool powered;
50
51 htrig = to_hci_basic_led_trigger(led_cdev->trigger);
52 powered = test_bit(HCI_UP, &htrig->hdev->flags);
53
54 led_trigger_event(led_cdev->trigger, powered ? LED_FULL : LED_OFF);
55
56 return 0;
55}
56
57static struct led_trigger *led_allocate_basic(struct hci_dev *hdev,
57}
58
59static struct led_trigger *led_allocate_basic(struct hci_dev *hdev,
58 void (*activate)(struct led_classdev *led_cdev),
60 int (*activate)(struct led_classdev *led_cdev),
59 const char *name)
60{
61 struct hci_basic_led_trigger *htrig;
62
63 htrig = devm_kzalloc(&hdev->dev, sizeof(*htrig), GFP_KERNEL);
64 if (!htrig)
65 return NULL;
66

--- 35 unchanged lines hidden ---
61 const char *name)
62{
63 struct hci_basic_led_trigger *htrig;
64
65 htrig = devm_kzalloc(&hdev->dev, sizeof(*htrig), GFP_KERNEL);
66 if (!htrig)
67 return NULL;
68

--- 35 unchanged lines hidden ---