2008-07-22 10:17:51

by Dmitry Baryshkov

[permalink] [raw]
Subject: [PATCH 1/2] RFKILL: allow one to specify led trigger name

Allow the rfkill driver to specify led trigger name.
By default it still defaults to the name of rfkill switch.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Cc: Henrique de Moraes Holschuh <[email protected]>
Cc: Ivo van Doorn <[email protected]>
---
net/rfkill/rfkill.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
index 4e10a95..b247677 100644
--- a/net/rfkill/rfkill.c
+++ b/net/rfkill/rfkill.c
@@ -355,7 +355,8 @@ 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;
error = led_trigger_register(&rfkill->led_trigger);
if (error)
rfkill->led_trigger.name = NULL;
--
1.5.6.2


--
With best wishes
Dmitry



2008-07-22 16:54:55

by Ivo Van Doorn

[permalink] [raw]
Subject: Re: [PATCH 1/2] RFKILL: allow one to specify led trigger name

On Tuesday 22 July 2008, Dmitry Baryshkov wrote:
> Allow the rfkill driver to specify led trigger name.
> By default it still defaults to the name of rfkill switch.
>
> Signed-off-by: Dmitry Baryshkov <[email protected]>
> Cc: Henrique de Moraes Holschuh <[email protected]>
> Cc: Ivo van Doorn <[email protected]>

Acked-by: Ivo van Doorn <[email protected]>

> ---
> net/rfkill/rfkill.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
> index 4e10a95..b247677 100644
> --- a/net/rfkill/rfkill.c
> +++ b/net/rfkill/rfkill.c
> @@ -355,7 +355,8 @@ 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;
> error = led_trigger_register(&rfkill->led_trigger);
> if (error)
> rfkill->led_trigger.name = NULL;
> --
> 1.5.6.2
>
>



Subject: Re: [PATCH 1/2] RFKILL: allow one to specify led trigger name

On Tue, 22 Jul 2008, Dmitry Baryshkov wrote:
> Allow the rfkill driver to specify led trigger name.
> By default it still defaults to the name of rfkill switch.
>
> Signed-off-by: Dmitry Baryshkov <[email protected]>
Acked-by: Henrique de Moraes Holschuh <[email protected]>
> Cc: Ivo van Doorn <[email protected]>
> ---
> net/rfkill/rfkill.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
> index 4e10a95..b247677 100644
> --- a/net/rfkill/rfkill.c
> +++ b/net/rfkill/rfkill.c
> @@ -355,7 +355,8 @@ 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;
> error = led_trigger_register(&rfkill->led_trigger);
> if (error)
> rfkill->led_trigger.name = NULL;
> --
> 1.5.6.2
>
>

--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh