aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/riva
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/riva
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/riva')
-rw-r--r--drivers/video/riva/fbdev.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 90363943bd57..8ddb47a56b07 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -354,14 +354,15 @@ static struct backlight_properties riva_bl_data = {
354 354
355static void riva_bl_set_power(struct fb_info *info, int power) 355static void riva_bl_set_power(struct fb_info *info, int power)
356{ 356{
357 if (info->bl_dev == NULL)
358 return;
359
360 mutex_lock(&info->bl_mutex); 357 mutex_lock(&info->bl_mutex);
361 up(&info->bl_dev->sem); 358
362 info->bl_dev->props->power = power; 359 if (info->bl_dev) {
363 __riva_bl_update_status(info->bl_dev); 360 down(&info->bl_dev->sem);
364 down(&info->bl_dev->sem); 361 info->bl_dev->props->power = power;
362 __riva_bl_update_status(info->bl_dev);
363 up(&info->bl_dev->sem);
364 }
365
365 mutex_unlock(&info->bl_mutex); 366 mutex_unlock(&info->bl_mutex);
366} 367}
367 368
@@ -396,11 +397,11 @@ static void riva_bl_init(struct riva_par *par)
396 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL); 397 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL);
397 mutex_unlock(&info->bl_mutex); 398 mutex_unlock(&info->bl_mutex);
398 399
399 up(&bd->sem); 400 down(&bd->sem);
400 bd->props->brightness = riva_bl_data.max_brightness; 401 bd->props->brightness = riva_bl_data.max_brightness;
401 bd->props->power = FB_BLANK_UNBLANK; 402 bd->props->power = FB_BLANK_UNBLANK;
402 bd->props->update_status(bd); 403 bd->props->update_status(bd);
403 down(&bd->sem); 404 up(&bd->sem);
404 405
405#ifdef CONFIG_PMAC_BACKLIGHT 406#ifdef CONFIG_PMAC_BACKLIGHT
406 mutex_lock(&pmac_backlight_mutex); 407 mutex_lock(&pmac_backlight_mutex);