lkml.org 
[lkml]   [2011]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Revert "leds: save the delay values after a successful call to blink_set()"
On Mon,  7 Nov 2011 11:36:37 +0100
Johan Hovold <jhovold@gmail.com> wrote:

> This reverts commit 6123b0e274503a0d3588e84fbe07c9aa01bfaf5d.
>
> The problem this patch intends to solve has already been fixed by commit
> 7a5caabd090b8f7 (drivers/leds/ledtrig-timer.c: fix broken sysfs delay
> handling).
>
> Signed-off-by: Johan Hovold <jhovold@gmail.com>

Sorry for not replying earlier, I was on vacation.

Thanks Johan, I've just verified the timer trigger works fine on 3.1
indeed even without my changes. But keep reading, please.

> ---
>
> Hi,
>
> A fix for the problem with the delay parameters not being stored is already in
> 3.1 (and stable). Rather than storing both values at every call to
> led_blink_set only the updated value is stored in led_delay_{on,off}_store in
> ledtrig-timer.c.
>

I thought that this was better fixed in the led_blink_set() directly,
as delay_on and delay_off are led_cdev fields after all, not
necessarily specific to ledtrig-timer, what about other users of them?
For example I can see led_blink_set() used in: net/mac80211/led.c
and led_trigger_blink(), which uses led_blink_set() in:
drivers/power/power_supply_leds.c

Maybe I am missing something.

Regards,
Antonio

> Thanks,
> Johan
>
> drivers/leds/led-class.c | 5 +----
> 1 files changed, 1 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
> index 661b692..6d5628b 100644
> --- a/drivers/leds/led-class.c
> +++ b/drivers/leds/led-class.c
> @@ -270,11 +270,8 @@ void led_blink_set(struct led_classdev *led_cdev,
> del_timer_sync(&led_cdev->blink_timer);
>
> if (led_cdev->blink_set &&
> - !led_cdev->blink_set(led_cdev, delay_on, delay_off)) {
> - led_cdev->blink_delay_on = *delay_on;
> - led_cdev->blink_delay_off = *delay_off;
> + !led_cdev->blink_set(led_cdev, delay_on, delay_off))
> return;
> - }
>
> /* blink with 1 Hz as default if nothing specified */
> if (!*delay_on && !*delay_off)
> --
> 1.7.6
>
>

--
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2011-11-16 22:23    [W:0.074 / U:20.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site