Subject: [PATCH 04/15] video: fbdev: radeon: Introduce backlight_get_brightness()

From: Sam Ravnborg <[email protected]>

Introduce backlight_get_brightness() to simplify logic
and avoid direct access to backlight properties.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: [email protected]
---
drivers/video/fbdev/aty/radeon_backlight.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/video/fbdev/aty/radeon_backlight.c b/drivers/video/fbdev/aty/radeon_backlight.c
index d2c1263ad260..22a39fea7b89 100644
--- a/drivers/video/fbdev/aty/radeon_backlight.c
+++ b/drivers/video/fbdev/aty/radeon_backlight.c
@@ -54,14 +54,10 @@ static int radeon_bl_update_status(struct backlight_device *bd)
return 0;

/* We turn off the LCD completely instead of just dimming the
- * backlight. This provides some greater power saving and the display
- * is useless without backlight anyway.
+ * backlight if level < 1. This provides some greater power saving
+ * and the display is useless without backlight anyway.
*/
- if (bd->props.power != FB_BLANK_UNBLANK ||
- bd->props.fb_blank != FB_BLANK_UNBLANK)
- level = 0;
- else
- level = bd->props.brightness;
+ level = backlight_get_brightness(bd);

del_timer_sync(&rinfo->lvds_timer);
radeon_engine_idle();

--
2.34.1