From 1d2cb23e543f78f044efe9760cfb97ff4994c73f Mon Sep 17 00:00:00 2001 From: Shuah Khan Date: Tue, 29 May 2012 15:07:27 -0700 Subject: [PATCH] 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 Cc: Richard Purdie Cc: Bryan Wu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/leds.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/leds.h b/include/linux/leds.h index 5884def15a248..39eee41d8c6f4 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 }; -- 2.39.5