aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSamu Onkalo <samu.p.onkalo@nokia.com>2010-11-24 15:57:03 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-11-24 16:50:42 -0500
commit87dbf6234d965851e7e13cbe80ad439f5fcb99c8 (patch)
treec52a728afabfbc01ec7ccfd8187845d11ed578d9 /drivers
parent9fdb18b6cb225fa7a874985fcb4a370cce1ac086 (diff)
drivers/leds/leds-lp5523.c: change some macros to functions
A small macro changed to inline function to have proper type checking. Inline added to two similar small functions. 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')
-rw-r--r--drivers/leds/leds-lp5523.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index 1e11fcc08b28..053e1f8b6c0b 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -134,15 +134,18 @@ struct lp5523_chip {
134 u8 num_leds; 134 u8 num_leds;
135}; 135};
136 136
137#define cdev_to_led(c) container_of(c, struct lp5523_led, cdev) 137static inline struct lp5523_led *cdev_to_led(struct led_classdev *cdev)
138{
139 return container_of(cdev, struct lp5523_led, cdev);
140}
138 141
139static struct lp5523_chip *engine_to_lp5523(struct lp5523_engine *engine) 142static inline struct lp5523_chip *engine_to_lp5523(struct lp5523_engine *engine)
140{ 143{
141 return container_of(engine, struct lp5523_chip, 144 return container_of(engine, struct lp5523_chip,
142 engines[engine->id - 1]); 145 engines[engine->id - 1]);
143} 146}
144 147
145static struct lp5523_chip *led_to_lp5523(struct lp5523_led *led) 148static inline struct lp5523_chip *led_to_lp5523(struct lp5523_led *led)
146{ 149{
147 return container_of(led, struct lp5523_chip, 150 return container_of(led, struct lp5523_chip,
148 leds[led->id]); 151 leds[led->id]);