Skip to content

Commit

Permalink
drivers/leds/leds-lp5523.c: change some macros to functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Samu Onkalo authored and Linus Torvalds committed Nov 24, 2010
1 parent 9fdb18b commit 87dbf62
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/leds/leds-lp5523.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 87dbf62

Please sign in to comment.