aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lp5521.c
diff options
context:
space:
mode:
authorSamu Onkalo <samu.p.onkalo@nokia.com>2010-11-24 15:57:02 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-11-24 16:50:41 -0500
commit9fdb18b6cb225fa7a874985fcb4a370cce1ac086 (patch)
treeef8654dc7c1b959fbf9374695e991107eca443da /drivers/leds/leds-lp5521.c
parenta0822c55779d9319939eac69f00bb729ea9d23da (diff)
drivers/leds/leds-lp5521.c: change some macros to functions
Some small macros changed to inline functions to have proper type checking. Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/leds/leds-lp5521.c')
-rw-r--r--drivers/leds/leds-lp5521.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
index 3782f31f06d2..fe69e5229a57 100644
--- a/drivers/leds/leds-lp5521.c
+++ b/drivers/leds/leds-lp5521.c
@@ -125,11 +125,22 @@ struct lp5521_chip {
125 u8 num_leds; 125 u8 num_leds;
126}; 126};
127 127
128#define cdev_to_led(c) container_of(c, struct lp5521_led, cdev) 128static inline struct lp5521_led *cdev_to_led(struct led_classdev *cdev)
129#define engine_to_lp5521(eng) container_of((eng), struct lp5521_chip, \ 129{
130 engines[(eng)->id - 1]) 130 return container_of(cdev, struct lp5521_led, cdev);
131#define led_to_lp5521(led) container_of((led), struct lp5521_chip, \ 131}
132 leds[(led)->id]) 132
133static inline struct lp5521_chip *engine_to_lp5521(struct lp5521_engine *engine)
134{
135 return container_of(engine, struct lp5521_chip,
136 engines[engine->id - 1]);
137}
138
139static inline struct lp5521_chip *led_to_lp5521(struct lp5521_led *led)
140{
141 return container_of(led, struct lp5521_chip,
142 leds[led->id]);
143}
133 144
134static void lp5521_led_brightness_work(struct work_struct *work); 145static void lp5521_led_brightness_work(struct work_struct *work);
135 146