Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9fdb18b6 authored by Samu Onkalo's avatar Samu Onkalo Committed by Linus Torvalds
Browse files

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: default avatarSamu Onkalo <samu.p.onkalo@nokia.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a0822c55
Loading
Loading
Loading
Loading
+16 −5
Original line number Original line Diff line number Diff line
@@ -125,11 +125,22 @@ struct lp5521_chip {
	u8			num_leds;
	u8			num_leds;
};
};


#define cdev_to_led(c)		container_of(c, struct lp5521_led, cdev)
static inline struct lp5521_led *cdev_to_led(struct led_classdev *cdev)
#define engine_to_lp5521(eng)	container_of((eng), struct lp5521_chip, \
{
						engines[(eng)->id - 1])
	return container_of(cdev, struct lp5521_led, cdev);
#define led_to_lp5521(led)	container_of((led), struct lp5521_chip, \
}
						leds[(led)->id])

static inline struct lp5521_chip *engine_to_lp5521(struct lp5521_engine *engine)
{
	return container_of(engine, struct lp5521_chip,
			    engines[engine->id - 1]);
}

static inline struct lp5521_chip *led_to_lp5521(struct lp5521_led *led)
{
	return container_of(led, struct lp5521_chip,
			    leds[led->id]);
}


static void lp5521_led_brightness_work(struct work_struct *work);
static void lp5521_led_brightness_work(struct work_struct *work);