Hi, Here is a patch for rfkill sitting in my queue. It depends on the leds-make-sure-led-trigger-is-valid-before-calling-trigger-activate.patch lately merged into -mm, which hopefully will be merged into mainline soon after 2.6.27 window opens. >From b69b08959d1b1bb989b156492346441dd4a04423 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov <dbaryshkov@xxxxxxxxx> Date: Fri, 20 Jun 2008 01:48:17 +0400 Subject: [PATCH] RFKILL: small improvements for leds handling allow one to override the name of the led trigger provide default activate function to set the state of the led. Signed-off-by: Dmitry Baryshkov <dbaryshkov@xxxxxxxxx> --- net/rfkill/rfkill.c | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c index 4e10a95..e9010ff 100644 --- a/net/rfkill/rfkill.c +++ b/net/rfkill/rfkill.c @@ -57,6 +57,16 @@ static void rfkill_led_trigger(struct rfkill *rfkill, #endif /* CONFIG_RFKILL_LEDS */ } +#ifdef CONFIG_RFKILL_LEDS +static void rfkill_led_trigger_activate(struct led_classdev *led) +{ + struct rfkill *rfkill = container_of(led->trigger, + struct rfkill, led_trigger); + + rfkill_led_trigger(rfkill, rfkill->state); +} +#endif /* CONFIG_RFKILL_LEDS */ + static int rfkill_toggle_radio(struct rfkill *rfkill, enum rfkill_state state) { @@ -355,7 +365,10 @@ static void rfkill_led_trigger_register(struct rfkill *rfkill) #ifdef CONFIG_RFKILL_LEDS int error; - rfkill->led_trigger.name = rfkill->dev.bus_id; + if (!rfkill->led_trigger.name) + rfkill->led_trigger.name = rfkill->dev.bus_id; + if (!rfkill->led_trigger.activate) + rfkill->led_trigger.activate = rfkill_led_trigger_activate; error = led_trigger_register(&rfkill->led_trigger); if (error) rfkill->led_trigger.name = NULL; -- 1.5.5.4 -- With best wishes Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html