From: Shuah Khan <shuahkhan@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: shuahkhan@gmail.com, LKML <linux-kernel@vger.kernel.org>,
Richard Purdie <richard.purdie@linuxfoundation.org>
Subject: [PATCH] leds: change ledtrig-timer to use activated flag
Date: Fri, 20 Apr 2012 14:17:25 -0600 [thread overview]
Message-ID: <1334953045.3255.17.camel@lorien2> (raw)
In-Reply-To: <1334893688.3051.5.camel@lorien2>
Changed existing timer trigger to use activated flag to set activate
successful status in activate routine and check it in deactivate
routine to do cleanup.
>From 4b7baef37d25b5ba5ed9f561375157e2a717e28f Mon Sep 17 00:00:00 2001
From: Shuah Khan <shuahkhan@gmail.com>
Date: Fri, 20 Apr 2012 13:07:20 -0600
Subject: [PATCH] leds: change ledtrig-timer to use activated flag
Signed-off-by: Shuah Khan <shuahkhan@gmail.com>
---
drivers/leds/ledtrig-timer.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/leds/ledtrig-timer.c b/drivers/leds/ledtrig-timer.c
index 328c64c..e20d1db 100644
--- a/drivers/leds/ledtrig-timer.c
+++ b/drivers/leds/ledtrig-timer.c
@@ -95,8 +95,7 @@ static void timer_trig_activate(struct led_classdev *led_cdev)
led_blink_set(led_cdev, &led_cdev->blink_delay_on,
&led_cdev->blink_delay_off);
-
- led_cdev->trigger_data = (void *)1;
+ led_cdev->activated = true;
return;
@@ -106,9 +105,10 @@ err_out_delayon:
static void timer_trig_deactivate(struct led_classdev *led_cdev)
{
- if (led_cdev->trigger_data) {
+ if (led_cdev->activated) {
device_remove_file(led_cdev->dev, &dev_attr_delay_on);
device_remove_file(led_cdev->dev, &dev_attr_delay_off);
+ led_cdev->activated = false;
}
/* Stop blinking */
--
1.7.5.4
next prev parent reply other threads:[~2012-04-20 20:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-17 23:05 [PATCH] leds: ledtrig-timer trigger_data allocation fix Shuah Khan
2012-04-17 23:12 ` Andrew Morton
2012-04-20 3:48 ` [PATCH] leds: add new field to led_classdev struct to save activation state Shuah Khan
2012-04-20 20:14 ` [PATCH ] leds: change existing triggers to use activated flag Shuah Khan
2012-04-20 20:17 ` Shuah Khan [this message]
2012-04-20 21:03 ` [PATCH] leds: change ledtrig-timer " Andrew Morton
2012-04-20 21:16 ` Shuah Khan
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=1334953045.3255.17.camel@lorien2 \
--to=shuahkhan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=richard.purdie@linuxfoundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.