[PATCH 05/15] video: fbdev: riva: Introduce backlight_get_brightness()
From: Sam Ravnborg via B4 Submission Endpoint
Date: Sat Jan 07 2023 - 13:27:00 EST
From: Sam Ravnborg <sam@xxxxxxxxxxxx>
Introduce backlight_get_brightness() to simplify logic
and avoid direct access to backlight properties.
Signed-off-by: Sam Ravnborg <sam@xxxxxxxxxxxx>
Cc: Antonino Daplas <adaplas@xxxxxxxxx>
Cc: linux-fbdev@xxxxxxxxxxxxxxx
---
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 644278146d3b..41edc6e79460 100644
--- a/drivers/video/fbdev/riva/fbdev.c
+++ b/drivers/video/fbdev/riva/fbdev.c
@@ -293,13 +293,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.34.1