]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
leds: add new field to led_classdev struct to save activation state
authorShuah Khan <shuahkhan@gmail.com>
Thu, 3 May 2012 05:44:25 +0000 (15:44 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 3 May 2012 05:46:48 +0000 (15:46 +1000)
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/leds.h

index 5884def15a24872a2b4be5ef9abe815fad233388..39eee41d8c6f4deee39d6904087a567657a2349e 100644 (file)
@@ -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
 };