diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-09-04 06:41:37 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-09-04 06:41:37 -0400 |
commit | f9bcda7760e1373615c9f6d9ce24209b0ab97de1 (patch) | |
tree | f90b3031126c4e4beb8161f38ea436303e2b8b73 /drivers/video/nvidia/nv_backlight.c | |
parent | 9bec2e38527a9f2497b3d976715c672d08d6160d (diff) | |
parent | c336923b668fdcf0312efbec3b44895d713f4d81 (diff) |
Merge branch 'master' into upstream
Diffstat (limited to 'drivers/video/nvidia/nv_backlight.c')
-rw-r--r-- | drivers/video/nvidia/nv_backlight.c | 18 |
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 = { | |||
113 | void nvidia_bl_set_power(struct fb_info *info, int power) | 113 | void 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); |