[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220607192335.1137249-8-steve@sk2.org>
Date: Tue, 7 Jun 2022 21:23:35 +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 7/7] fbdev: riva: 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: Antonino Daplas <adaplas@...il.com>
Cc: Helge Deller <deller@....de>
Cc: linux-fbdev@...r.kernel.org
Cc: dri-devel@...ts.freedesktop.org
---
drivers/video/fbdev/riva/fbdev.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/video/fbdev/riva/fbdev.c b/drivers/video/fbdev/riva/fbdev.c
index 84d5e23ad7d3..534722b38053 100644
--- a/drivers/video/fbdev/riva/fbdev.c
+++ b/drivers/video/fbdev/riva/fbdev.c
@@ -292,13 +292,7 @@ static int riva_bl_update_status(struct backlight_device *bd)
{
struct riva_par *par = bl_get_data(bd);
U032 tmp_pcrt, tmp_pmc;
- int level;
-
- if (bd->props.power != FB_BLANK_UNBLANK ||
- bd->props.fb_blank != FB_BLANK_UNBLANK)
- level = 0;
- else
- level = bd->props.brightness;
+ int level = backlight_get_brightness(bd);
tmp_pmc = NV_RD32(par->riva.PMC, 0x10F0) & 0x0000FFFF;
tmp_pcrt = NV_RD32(par->riva.PCRTC0, 0x081C) & 0xFFFFFFFC;
--
2.30.2
Powered by blists - more mailing lists