Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Shuah Khan and committed by
Linus Torvalds
b0096182 1daef6d2

+2
+2
include/linux/leds.h
··· 73 73 struct led_trigger *trigger; 74 74 struct list_head trig_list; 75 75 void *trigger_data; 76 + /* true if activated - deactivate routine uses it to do cleanup */ 77 + bool activated; 76 78 #endif 77 79 }; 78 80