aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDmitry Baryshkov <dbaryshkov@gmail.com>2008-07-22 06:21:59 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-08-01 15:31:33 -0400
commit96185664f10e79d038c084305d3cacff9b52204f (patch)
tree9134c0e018b86d84e2f9f86561b4c7a44ef933f9 /net
parent7c4f4578fc85d42d149f86b47f76c28626a20d92 (diff)
RFKILL: set the status of the leds on activation.
Provide default activate function to set the state of the led when the led becomes bound to the trigger Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/rfkill/rfkill.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
index 5c24f3647189..d2d45655cd1a 100644
--- a/net/rfkill/rfkill.c
+++ b/net/rfkill/rfkill.c
@@ -105,6 +105,16 @@ static void rfkill_led_trigger(struct rfkill *rfkill,
105#endif /* CONFIG_RFKILL_LEDS */ 105#endif /* CONFIG_RFKILL_LEDS */
106} 106}
107 107
108#ifdef CONFIG_RFKILL_LEDS
109static void rfkill_led_trigger_activate(struct led_classdev *led)
110{
111 struct rfkill *rfkill = container_of(led->trigger,
112 struct rfkill, led_trigger);
113
114 rfkill_led_trigger(rfkill, rfkill->state);
115}
116#endif /* CONFIG_RFKILL_LEDS */
117
108static void notify_rfkill_state_change(struct rfkill *rfkill) 118static void notify_rfkill_state_change(struct rfkill *rfkill)
109{ 119{
110 blocking_notifier_call_chain(&rfkill_notifier_list, 120 blocking_notifier_call_chain(&rfkill_notifier_list,
@@ -591,6 +601,8 @@ static void rfkill_led_trigger_register(struct rfkill *rfkill)
591 601
592 if (!rfkill->led_trigger.name) 602 if (!rfkill->led_trigger.name)
593 rfkill->led_trigger.name = rfkill->dev.bus_id; 603 rfkill->led_trigger.name = rfkill->dev.bus_id;
604 if (!rfkill->led_trigger.activate)
605 rfkill->led_trigger.activate = rfkill_led_trigger_activate;
594 error = led_trigger_register(&rfkill->led_trigger); 606 error = led_trigger_register(&rfkill->led_trigger);
595 if (error) 607 if (error)
596 rfkill->led_trigger.name = NULL; 608 rfkill->led_trigger.name = NULL;