From 51d53e5b06b8e75d02a17bfe678e7be7554a2322 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sun, 19 Jul 2020 10:07:41 +0200 Subject: backlight: Use backlight_get_brightness() throughout Introduce the backlight_get_brightness() helper in all video/backlight/* drivers. This simplifies the code and align the implementation of the update_status() operation across the different backlight drivers. Some of the drivers gains a little extra functionality by the change as they now respect the fb_blank() ioctl. Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones --- drivers/video/backlight/lm3533_bl.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'drivers/video/backlight/lm3533_bl.c') diff --git a/drivers/video/backlight/lm3533_bl.c b/drivers/video/backlight/lm3533_bl.c index 0c7830f793de..1df1b6643c0b 100644 --- a/drivers/video/backlight/lm3533_bl.c +++ b/drivers/video/backlight/lm3533_bl.c @@ -39,14 +39,8 @@ static inline int lm3533_bl_get_ctrlbank_id(struct lm3533_bl *bl) static int lm3533_bl_update_status(struct backlight_device *bd) { struct lm3533_bl *bl = bl_get_data(bd); - int brightness = bd->props.brightness; - if (bd->props.power != FB_BLANK_UNBLANK) - brightness = 0; - if (bd->props.fb_blank != FB_BLANK_UNBLANK) - brightness = 0; - - return lm3533_ctrlbank_set_brightness(&bl->cb, (u8)brightness); + return lm3533_ctrlbank_set_brightness(&bl->cb, backlight_get_brightness(bd)); } static int lm3533_bl_get_brightness(struct backlight_device *bd) -- cgit v1.2.3