summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStephen Kitt <steve@sk2.org>2022-06-07 21:23:32 +0200
committerHelge Deller <deller@gmx.de>2023-01-09 09:57:50 +0100
commit973fcf37c267f937fbec656f4643571d7bd09a37 (patch)
treeb9174b0a4a7892c529546d53490ab64b38acf788 /drivers
parentc28509ef9c221378a586e72643fc43102f5512e9 (diff)
downloadlinux-stable-973fcf37c267f937fbec656f4643571d7bd09a37.tar.gz
linux-stable-973fcf37c267f937fbec656f4643571d7bd09a37.tar.bz2
linux-stable-973fcf37c267f937fbec656f4643571d7bd09a37.zip
fbdev: mx3fb: Use backlight helper
Instead of retrieving the backlight brightness in struct backlight_properties manually, and then checking whether the backlight should be on at all, use backlight_get_brightness() which does all this and insulates this from future changes. Signed-off-by: Stephen Kitt <steve@sk2.org> Cc: Helge Deller <deller@gmx.de> Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/fbdev/mx3fb.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c
index b945b68984b9..76771e126d0a 100644
--- a/drivers/video/fbdev/mx3fb.c
+++ b/drivers/video/fbdev/mx3fb.c
@@ -283,12 +283,7 @@ static int mx3fb_bl_get_brightness(struct backlight_device *bl)
static int mx3fb_bl_update_status(struct backlight_device *bl)
{
struct mx3fb_data *fbd = bl_get_data(bl);
- int brightness = bl->props.brightness;
-
- if (bl->props.power != FB_BLANK_UNBLANK)
- brightness = 0;
- if (bl->props.fb_blank != FB_BLANK_UNBLANK)
- brightness = 0;
+ int brightness = backlight_get_brightness(bl);
fbd->backlight_level = (fbd->backlight_level & ~0xFF) | brightness;