lkml.org 
[lkml]   [2012]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] leds: add new field to led_classdev struct to save activation state
From
Date
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




\
 
 \ /
  Last update: 2012-04-20 05:51    [W:0.068 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site