aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/nvidia/nv_backlight.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/nvidia/nv_backlight.c')
-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);