Skip to content

Commit 8791906

Browse files
skitthdeller
authored andcommitted
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 <[email protected]> Cc: Antonino Daplas <[email protected]> Cc: Helge Deller <[email protected]> Cc: [email protected] Cc: [email protected] Reviewed-by: Daniel Thompson <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 450afd9 commit 8791906

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

drivers/video/fbdev/riva/fbdev.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,7 @@ static int riva_bl_update_status(struct backlight_device *bd)
293293
{
294294
struct riva_par *par = bl_get_data(bd);
295295
U032 tmp_pcrt, tmp_pmc;
296-
int level;
297-
298-
if (bd->props.power != FB_BLANK_UNBLANK ||
299-
bd->props.fb_blank != FB_BLANK_UNBLANK)
300-
level = 0;
301-
else
302-
level = bd->props.brightness;
296+
int level = backlight_get_brightness(bd);
303297

304298
tmp_pmc = NV_RD32(par->riva.PMC, 0x10F0) & 0x0000FFFF;
305299
tmp_pcrt = NV_RD32(par->riva.PCRTC0, 0x081C) & 0xFFFFFFFC;

0 commit comments

Comments
 (0)