From cab267c65f44337974e4f1eae490b21dce0e9811 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann Date: Wed, 28 Jun 2006 04:26:55 -0700 Subject: [PATCH] powermac backlight fixes Fix a erroneous calculation of the legacy brightness values as reported by Paul Collins. Additionally, it moves the calculation of the negative value in the radeonfb driver after the value check. Signed-off-by: Michael Hanselmann Acked-by: Benjamin Herrenschmidt Acked-by: Paul Collins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/aty/radeon_backlight.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/video/aty/radeon_backlight.c') diff --git a/drivers/video/aty/radeon_backlight.c b/drivers/video/aty/radeon_backlight.c index 7de66b855d4..1755dddf189 100644 --- a/drivers/video/aty/radeon_backlight.c +++ b/drivers/video/aty/radeon_backlight.c @@ -40,14 +40,14 @@ static int radeon_bl_get_level_brightness(struct radeon_bl_privdata *pdata, mutex_unlock(&info->bl_mutex); - if (pdata->negative) - rlevel = MAX_RADEON_LEVEL - rlevel; - if (rlevel < 0) rlevel = 0; else if (rlevel > MAX_RADEON_LEVEL) rlevel = MAX_RADEON_LEVEL; + if (pdata->negative) + rlevel = MAX_RADEON_LEVEL - rlevel; + return rlevel; } -- cgit v1.2.3-70-g09d2