[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220607192335.1137249-5-steve@sk2.org>
Date: Tue, 7 Jun 2022 21:23:32 +0200
From: Stephen Kitt <steve@....org>
To: Antonino Daplas <adaplas@...il.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Helge Deller <deller@....de>, Paul Mackerras <paulus@...ba.org>
Cc: linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Stephen Kitt <steve@....org>, dri-devel@...ts.freedesktop.org
Subject: [PATCH 4/7] 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@....org>
Cc: Helge Deller <deller@....de>
Cc: linux-fbdev@...r.kernel.org
Cc: dri-devel@...ts.freedesktop.org
---
drivers/video/fbdev/mx3fb.c | 7 +------
1 file changed, 1 insertion(+), 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;
--
2.30.2
Powered by blists - more mailing lists