Message ID | 20220607192335.1137249-2-steve@sk2.org (mailing list archive) |
---|---|
State | Handled Elsewhere, archived |
Headers | show |
Series | fbdev: Use backlight helpers | expand |
Hi Stepehen, On Tue, Jun 07, 2022 at 09:23:29PM +0200, Stephen Kitt wrote: > 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@sk2.org> > Cc: Paul Mackerras <paulus@samba.org> > Cc: Helge Deller <deller@gmx.de> > Cc: linux-fbdev@vger.kernel.org > Cc: dri-devel@lists.freedesktop.org This and the other 6 patches in this series are all: Reviewed-by: Sam Ravnborg <sam@ravnborg.org> I did not receive the cover letter, which is why I reply to this mail. Sam
diff --git a/drivers/video/fbdev/aty/aty128fb.c b/drivers/video/fbdev/aty/aty128fb.c index b26c81233b6b..a8f9baac3d3f 100644 --- a/drivers/video/fbdev/aty/aty128fb.c +++ b/drivers/video/fbdev/aty/aty128fb.c @@ -1765,12 +1765,10 @@ static int aty128_bl_update_status(struct backlight_device *bd) unsigned int reg = aty_ld_le32(LVDS_GEN_CNTL); int level; - if (bd->props.power != FB_BLANK_UNBLANK || - bd->props.fb_blank != FB_BLANK_UNBLANK || - !par->lcd_on) + if (!par->lcd_on) level = 0; else - level = bd->props.brightness; + level = backlight_get_brightness(bd); reg |= LVDS_BL_MOD_EN | LVDS_BLON; if (level > 0) {
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@sk2.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Helge Deller <deller@gmx.de> Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org --- drivers/video/fbdev/aty/aty128fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)