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, 11 insertions, 7 deletions
diff --git a/drivers/video/nvidia/nv_backlight.c b/drivers/video/nvidia/nv_backlight.c
index b45f577094ac..5b75ae4e9457 100644
--- a/drivers/video/nvidia/nv_backlight.c
+++ b/drivers/video/nvidia/nv_backlight.c
@@ -113,10 +113,14 @@ static struct backlight_properties nvidia_bl_data = {
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 mutex_lock(&info->bl_mutex); 115 mutex_lock(&info->bl_mutex);
116 up(&info->bl_dev->sem); 116
117 info->bl_dev->props->power = power; 117 if (info->bl_dev) {
118 __nvidia_bl_update_status(info->bl_dev); 118 down(&info->bl_dev->sem);
119 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
120 mutex_unlock(&info->bl_mutex); 124 mutex_unlock(&info->bl_mutex);
121} 125}
122 126
@@ -140,7 +144,7 @@ void nvidia_bl_init(struct nvidia_par *par)
140 bd = backlight_device_register(name, par, &nvidia_bl_data); 144 bd = backlight_device_register(name, par, &nvidia_bl_data);
141 if (IS_ERR(bd)) { 145 if (IS_ERR(bd)) {
142 info->bl_dev = NULL; 146 info->bl_dev = NULL;
143 printk("nvidia: Backlight registration failed\n"); 147 printk(KERN_WARNING "nvidia: Backlight registration failed\n");
144 goto error; 148 goto error;
145 } 149 }
146 150
@@ -151,11 +155,11 @@ void nvidia_bl_init(struct nvidia_par *par)
151 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL); 155 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL);
152 mutex_unlock(&info->bl_mutex); 156 mutex_unlock(&info->bl_mutex);
153 157
154 up(&bd->sem); 158 down(&bd->sem);
155 bd->props->brightness = nvidia_bl_data.max_brightness; 159 bd->props->brightness = nvidia_bl_data.max_brightness;
156 bd->props->power = FB_BLANK_UNBLANK; 160 bd->props->power = FB_BLANK_UNBLANK;
157 bd->props->update_status(bd); 161 bd->props->update_status(bd);
158 down(&bd->sem); 162 up(&bd->sem);
159 163
160#ifdef CONFIG_PMAC_BACKLIGHT 164#ifdef CONFIG_PMAC_BACKLIGHT
161 mutex_lock(&pmac_backlight_mutex); 165 mutex_lock(&pmac_backlight_mutex);