summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorShuah Khan <shuahkhan@gmail.com>2012-05-30 00:07:27 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-30 01:22:31 +0200
commitb00961824a33aadec4a825eaeccfbe3db8ec7032 (patch)
treef3af8c9307bdf3b06b9fc21df9aea0356b89e2b5 /include
parentleds: Use kcalloc instead of kzalloc to allocate array (diff)
downloadlinux-b00961824a33aadec4a825eaeccfbe3db8ec7032.tar.xz
linux-b00961824a33aadec4a825eaeccfbe3db8ec7032.zip
leds: add new field to led_classdev struct to save activation state
Add 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. Signed-off-by: Shuah Khan <shuahkhan@gmail.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Bryan Wu <bryan.wu@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/leds.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 5884def15a24..39eee41d8c6f 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
};