提交 87dbf623 编写于 作者: S Samu Onkalo 提交者: Linus Torvalds

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: NSamu Onkalo <samu.p.onkalo@nokia.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 9fdb18b6
......@@ -134,15 +134,18 @@ struct lp5523_chip {
u8 num_leds;
};
#define cdev_to_led(c) container_of(c, struct lp5523_led, cdev)
static inline struct lp5523_led *cdev_to_led(struct led_classdev *cdev)
{
return container_of(cdev, struct lp5523_led, cdev);
}
static struct lp5523_chip *engine_to_lp5523(struct lp5523_engine *engine)
static inline struct lp5523_chip *engine_to_lp5523(struct lp5523_engine *engine)
{
return container_of(engine, struct lp5523_chip,
engines[engine->id - 1]);
}
static struct lp5523_chip *led_to_lp5523(struct lp5523_led *led)
static inline struct lp5523_chip *led_to_lp5523(struct lp5523_led *led)
{
return container_of(led, struct lp5523_chip,
leds[led->id]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册