aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/aty/atyfb_base.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2006-09-01 00:27:54 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-01 14:39:10 -0400
commita930363881c225fb52824145d1ba8f1a8c447dd8 (patch)
tree1e6996560b2cdf9d3978a085bdd1b2ebb4a934a7 /drivers/video/aty/atyfb_base.c
parent4cfb04a9d3d6865d932d02616b27b89d3a634026 (diff)
[PATCH] backlight last round of fixes
Fix some more problems (inverted use of semaphores in some places). He also moved my checks into within the protected section which is better. Signed-off-by: Michael Hanselmann <linux-kernel@hansmi.ch> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/aty/atyfb_base.c')
-rw-r--r--drivers/video/aty/atyfb_base.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 510e4ea296ed..19a71f045784 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -2199,14 +2199,15 @@ static struct backlight_properties aty_bl_data = {
2199 2199
2200static void aty_bl_set_power(struct fb_info *info, int power) 2200static void aty_bl_set_power(struct fb_info *info, int power)
2201{ 2201{
2202 if (info->bl_dev == NULL)
2203 return;
2204
2205 mutex_lock(&info->bl_mutex); 2202 mutex_lock(&info->bl_mutex);
2206 up(&info->bl_dev->sem); 2203
2207 info->bl_dev->props->power = power; 2204 if (info->bl_dev) {
2208 __aty_bl_update_status(info->bl_dev); 2205 down(&info->bl_dev->sem);
2209 down(&info->bl_dev->sem); 2206 info->bl_dev->props->power = power;
2207 __aty_bl_update_status(info->bl_dev);
2208 up(&info->bl_dev->sem);
2209 }
2210
2210 mutex_unlock(&info->bl_mutex); 2211 mutex_unlock(&info->bl_mutex);
2211} 2212}
2212 2213
@@ -2237,11 +2238,11 @@ static void aty_bl_init(struct atyfb_par *par)
2237 0xFF * FB_BACKLIGHT_MAX / MAX_LEVEL); 2238 0xFF * FB_BACKLIGHT_MAX / MAX_LEVEL);
2238 mutex_unlock(&info->bl_mutex); 2239 mutex_unlock(&info->bl_mutex);
2239 2240
2240 up(&bd->sem); 2241 down(&bd->sem);
2241 bd->props->brightness = aty_bl_data.max_brightness; 2242 bd->props->brightness = aty_bl_data.max_brightness;
2242 bd->props->power = FB_BLANK_UNBLANK; 2243 bd->props->power = FB_BLANK_UNBLANK;
2243 bd->props->update_status(bd); 2244 bd->props->update_status(bd);
2244 down(&bd->sem); 2245 up(&bd->sem);
2245 2246
2246#ifdef CONFIG_PMAC_BACKLIGHT 2247#ifdef CONFIG_PMAC_BACKLIGHT
2247 mutex_lock(&pmac_backlight_mutex); 2248 mutex_lock(&pmac_backlight_mutex);