From: Johannes Berg <johannes.berg@intel.com>
To: Antonio Ospite <ospite@studenti.unina.it>
Cc: Richard Purdie <rpurdie@rpsys.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] leds: save the delay values after a successful call to blink_set()
Date: Fri, 07 Oct 2011 09:38:38 +0200 [thread overview]
Message-ID: <1317973118.3988.2.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1317938611-4418-2-git-send-email-ospite@studenti.unina.it>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2373 bytes --]
On Thu, 2011-10-06 at 22:03 +0000, Antonio Ospite wrote:
> When calling the hardware blinking function implemented by blink_set(),
> the delay_on and delay_off values are not preserved across calls.
>
> Fix that and make the "timer" trigger work as expected when hardware
> blinking is available.
>
> BEFORE the fix:
> $ cd /sys/class/leds/someled
> $ echo timer > trigger
> $ cat delay_on delay_off
> 0
> 0
> $ echo 100 > delay_on
> $ cat delay_on delay_off
> 0
> 0
> $ echo 100 > delay_off
> $ cat delay_on delay_off
> 0
> 0
>
> AFTER the fix:
> $ cd /sys/class/leds/someled
> $ echo timer > trigger
> $ cat delay_on delay_off
> 0
> 0
> $ echo 100 > delay_on
> $ cat delay_on delay_off
> 100
> 0
> $ echo 100 > delay_off
> $ cat delay_on delay_off
> 100
> 100
>
> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
> ---
> drivers/leds/led-class.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
> index d5a4ade..939f24a 100644
> --- a/drivers/leds/led-class.c
> +++ b/drivers/leds/led-class.c
> @@ -267,8 +267,11 @@ void led_blink_set(struct led_classdev *led_cdev,
> unsigned long *delay_off)
> {
> if (led_cdev->blink_set &&
> - !led_cdev->blink_set(led_cdev, delay_on, delay_off))
> + !led_cdev->blink_set(led_cdev, delay_on, delay_off)) {
> + led_cdev->blink_delay_on = *delay_on;
> + led_cdev->blink_delay_off = *delay_off;
> return;
> + }
Looks good to me. I suspect I created this bug because originally it
might have put the values into there first and then called blink_set().
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
johannes
--------------------------------------------------------------------------------------
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Douglas Lusk, Peter Gleissner, Hannes Schwaderer
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
next prev parent reply other threads:[~2011-10-07 7:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-06 22:03 [PATCH 0/2] leds: some issues with hardware blinking Antonio Ospite
2011-10-06 22:03 ` [PATCH 1/2] leds: save the delay values after a successful call to blink_set() Antonio Ospite
2011-10-07 7:38 ` Johannes Berg [this message]
2011-11-07 10:36 ` [PATCH] Revert "leds: save the delay values after a successful call to blink_set()" Johan Hovold
2011-11-16 21:21 ` Antonio Ospite
2011-11-18 19:06 ` Johan Hovold
2011-10-06 22:03 ` [PATCH 2/2] leds: turn the blink_timer off before starting to blink Antonio Ospite
2011-10-07 7:39 ` Johannes Berg
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=1317973118.3988.2.camel@jlt3.sipsolutions.net \
--to=johannes.berg@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ospite@studenti.unina.it \
--cc=rpurdie@rpsys.net \
/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