aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/nvidia
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/nvidia
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/nvidia')
-rw-r--r--drivers/video/nvidia/nv_backlight.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/video/nvidia/nv_backlight.c b/drivers/video/nvidia/nv_backlight.c
index 14c37c42191c..5b75ae4e9457 100644
--- a/drivers/video/nvidia/nv_backlight.c
+++ b/drivers/video/nvidia/nv_backlight.c
@@ -112,13 +112,15 @@ static struct backlight_properties nvidia_bl_data = {
112 112
113void nvidia_bl_set_power(struct fb_info *info, int power) 113void nvidia_bl_set_power(struct fb_info *info, int power)
114{ 114{
115 if (info->bl_dev == NULL)
116 return;
117 mutex_lock(&info->bl_mutex); 115 mutex_lock(&info->bl_mutex);
118 up(&info->bl_dev->sem); 116
119 info->bl_dev->props->power = power; 117 if (info->bl_dev) {
120 __nvidia_bl_update_status(info->bl_dev); 118 down(&info->bl_dev->sem);
121 down(&info->bl_dev->sem); 119 info->bl_dev->props->power = power;
120 __nvidia_bl_update_status(info->bl_dev);
121 up(&info->bl_dev->sem);
122 }
123
122 mutex_unlock(&info->bl_mutex); 124 mutex_unlock(&info->bl_mutex);
123} 125}
124 126
@@ -153,11 +155,11 @@ void nvidia_bl_init(struct nvidia_par *par)
153 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL); 155 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL);
154 mutex_unlock(&info->bl_mutex); 156 mutex_unlock(&info->bl_mutex);
155 157
156 up(&bd->sem); 158 down(&bd->sem);
157 bd->props->brightness = nvidia_bl_data.max_brightness; 159 bd->props->brightness = nvidia_bl_data.max_brightness;
158 bd->props->power = FB_BLANK_UNBLANK; 160 bd->props->power = FB_BLANK_UNBLANK;
159 bd->props->update_status(bd); 161 bd->props->update_status(bd);
160 down(&bd->sem); 162 up(&bd->sem);
161 163
162#ifdef CONFIG_PMAC_BACKLIGHT 164#ifdef CONFIG_PMAC_BACKLIGHT
163 mutex_lock(&pmac_backlight_mutex); 165 mutex_lock(&pmac_backlight_mutex);