From: Ivo van Doorn <ivdoorn@gmail.com>
To: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: linux-wireless@vger.kernel.org,
Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
akpm@linux-foundation.org
Subject: Re: [PATCH 2/2] RFKILL: set the status of the leds on activation.
Date: Tue, 22 Jul 2008 19:11:35 +0200 [thread overview]
Message-ID: <200807221911.35975.IvDoorn@gmail.com> (raw)
In-Reply-To: <20080722102159.GA32682@doriath.ww600.siemens.net>
On Tuesday 22 July 2008, Dmitry Baryshkov wrote:
> 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>
> Cc: Ivo van Doorn <IvDoorn@gmail.com>
> Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
> --
> This patch depends on the patch "leds: make sure led->trigger is set
> earlier" which was staged in -mm for some time and recently got merged
> into leds tree.
> ---
> net/rfkill/rfkill.c | 12 ++++++++++++
> 1 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
> index b247677..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)
> {
> @@ -357,6 +367,8 @@ static void rfkill_led_trigger_register(struct rfkill *rfkill)
>
> 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.6.2
>
>
next prev parent reply other threads:[~2008-07-22 16:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-22 10:21 [PATCH 2/2] RFKILL: set the status of the leds on activation Dmitry Baryshkov
2008-07-22 11:22 ` Henrique de Moraes Holschuh
2008-07-22 11:33 ` Dmitry
2008-07-22 11:38 ` Henrique de Moraes Holschuh
2008-07-22 12:09 ` Richard Purdie
2008-07-22 17:11 ` Ivo van Doorn [this message]
2008-07-27 7:37 ` Dmitry Baryshkov
2008-07-27 8:03 ` Ivo van Doorn
2008-07-27 13:57 ` Henrique de Moraes Holschuh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200807221911.35975.IvDoorn@gmail.com \
--to=ivdoorn@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=dbaryshkov@gmail.com \
--cc=hmh@hmh.eng.br \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).