public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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: add new field to led_classdev struct to save activation state
Date: Thu, 19 Apr 2012 21:48:08 -0600	[thread overview]
Message-ID: <1334893688.3051.5.camel@lorien2> (raw)
In-Reply-To: <20120417161239.57c41966.akpm@linux-foundation.org>

This patch adds a new field to led_classdev to save activattion state
after activate routine is successful. This saved state is used in 
deactivate routine to do cleanup such as removing device files, and
free memory allocated during activation. Currently trigger_data not being
null is used for this purpose.

Existing triggers will need changes to use this new field.

>From 3765101a5ffe32edd68a71bafca2d6d262cf2399 Mon Sep 17 00:00:00 2001
From: Shuah Khan <shuahkhan@gmail.com>
Date: Thu, 19 Apr 2012 20:44:15 -0600
Subject: [PATCH] leds: add new field to led_classdev struct to save
 activation state


Signed-off-by: Shuah Khan <shuahkhan@gmail.com>
---
 include/linux/leds.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/leds.h b/include/linux/leds.h
index 5884def..39eee41 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -73,6 +73,8 @@ struct led_classdev {
 	struct led_trigger	*trigger;
 	struct list_head	 trig_list;
 	void			*trigger_data;
+	/* true if activated - deactivate routine uses it to do cleanup */
+	bool			activated;
 #endif
 };
 
-- 
1.7.5.4




  reply	other threads:[~2012-04-20  3:48 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   ` Shuah Khan [this message]
2012-04-20 20:14     ` [PATCH ] leds: change existing triggers to use activated flag Shuah Khan
2012-04-20 20:17     ` [PATCH] leds: change ledtrig-timer " Shuah Khan
2012-04-20 21:03       ` 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=1334893688.3051.5.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox