2016-04-18 14:41:08

by Jacek Anaszewski

[permalink] [raw]
Subject: [PATCH] leds: ledtrig-ide-disk: Move ide_blink_delay to ledtrig_ide_activity()

Parameters delay_on and delay_off of led_trigger_blink_oneshot()
are pointers, to enable blink interval adjustment by LED class drivers
of the controllers that implement hardware blinking.

Move ide_blink_delay variable to ledtrig_ide_activity() in order to
prevent the situation when adjustment committed by one LED class
driver influences blink interval of the software fallback blink feature,
that is applied to the drivers that don't implement blink_set op.

Signed-off-by: Jacek Anaszewski <[email protected]>
---
drivers/leds/trigger/ledtrig-ide-disk.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/leds/trigger/ledtrig-ide-disk.c b/drivers/leds/trigger/ledtrig-ide-disk.c
index c02a3ac..15123d3 100644
--- a/drivers/leds/trigger/ledtrig-ide-disk.c
+++ b/drivers/leds/trigger/ledtrig-ide-disk.c
@@ -18,10 +18,11 @@
#define BLINK_DELAY 30

DEFINE_LED_TRIGGER(ledtrig_ide);
-static unsigned long ide_blink_delay = BLINK_DELAY;

void ledtrig_ide_activity(void)
{
+ unsigned long ide_blink_delay = BLINK_DELAY;
+
led_trigger_blink_oneshot(ledtrig_ide,
&ide_blink_delay, &ide_blink_delay, 0);
}
--
1.7.9.5


2016-04-18 14:57:20

by Boris Brezillon

[permalink] [raw]
Subject: Re: [PATCH] leds: ledtrig-ide-disk: Move ide_blink_delay to ledtrig_ide_activity()

On Mon, 18 Apr 2016 16:40:46 +0200
Jacek Anaszewski <[email protected]> wrote:

> Parameters delay_on and delay_off of led_trigger_blink_oneshot()
> are pointers, to enable blink interval adjustment by LED class drivers
> of the controllers that implement hardware blinking.
>
> Move ide_blink_delay variable to ledtrig_ide_activity() in order to
> prevent the situation when adjustment committed by one LED class
> driver influences blink interval of the software fallback blink feature,
> that is applied to the drivers that don't implement blink_set op.
>
> Signed-off-by: Jacek Anaszewski <[email protected]>

Reviewed-by: Boris Brezillon <[email protected]>

> ---
> drivers/leds/trigger/ledtrig-ide-disk.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/leds/trigger/ledtrig-ide-disk.c b/drivers/leds/trigger/ledtrig-ide-disk.c
> index c02a3ac..15123d3 100644
> --- a/drivers/leds/trigger/ledtrig-ide-disk.c
> +++ b/drivers/leds/trigger/ledtrig-ide-disk.c
> @@ -18,10 +18,11 @@
> #define BLINK_DELAY 30
>
> DEFINE_LED_TRIGGER(ledtrig_ide);
> -static unsigned long ide_blink_delay = BLINK_DELAY;
>
> void ledtrig_ide_activity(void)
> {
> + unsigned long ide_blink_delay = BLINK_DELAY;
> +
> led_trigger_blink_oneshot(ledtrig_ide,
> &ide_blink_delay, &ide_blink_delay, 0);
> }



--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

2016-04-19 07:09:18

by Jacek Anaszewski

[permalink] [raw]
Subject: Re: [PATCH] leds: ledtrig-ide-disk: Move ide_blink_delay to ledtrig_ide_activity()

Hi Boris,

Thanks for the review, patch applied.

Best regards,
Jacek Anaszewski

On 04/18/2016 04:57 PM, Boris Brezillon wrote:
> On Mon, 18 Apr 2016 16:40:46 +0200
> Jacek Anaszewski <[email protected]> wrote:
>
>> Parameters delay_on and delay_off of led_trigger_blink_oneshot()
>> are pointers, to enable blink interval adjustment by LED class drivers
>> of the controllers that implement hardware blinking.
>>
>> Move ide_blink_delay variable to ledtrig_ide_activity() in order to
>> prevent the situation when adjustment committed by one LED class
>> driver influences blink interval of the software fallback blink feature,
>> that is applied to the drivers that don't implement blink_set op.
>>
>> Signed-off-by: Jacek Anaszewski <[email protected]>
>
> Reviewed-by: Boris Brezillon <[email protected]>