Skip to content

Commit 1cc1759

Browse files
skitthdeller
authored andcommitted
fbdev: nvidia: 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 973fcf3 commit 1cc1759

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

drivers/video/fbdev/nvidia/nv_backlight.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,11 @@ static int nvidia_bl_update_status(struct backlight_device *bd)
4949
{
5050
struct nvidia_par *par = bl_get_data(bd);
5151
u32 tmp_pcrt, tmp_pmc, fpcontrol;
52-
int level;
52+
int level = backlight_get_brightness(bd);
5353

5454
if (!par->FlatPanel)
5555
return 0;
5656

57-
if (bd->props.power != FB_BLANK_UNBLANK ||
58-
bd->props.fb_blank != FB_BLANK_UNBLANK)
59-
level = 0;
60-
else
61-
level = bd->props.brightness;
62-
6357
tmp_pmc = NV_RD32(par->PMC, 0x10F0) & 0x0000FFFF;
6458
tmp_pcrt = NV_RD32(par->PCRTC0, 0x081C) & 0xFFFFFFFC;
6559
fpcontrol = NV_RD32(par->PRAMDAC, 0x0848) & 0xCFFFFFCC;

0 commit comments

Comments
 (0)