diff options
Diffstat (limited to 'drivers/video/riva/fbdev.c')
-rw-r--r-- | drivers/video/riva/fbdev.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c index 76fc9d355eb7..8ddb47a56b07 100644 --- a/drivers/video/riva/fbdev.c +++ b/drivers/video/riva/fbdev.c | |||
@@ -355,10 +355,14 @@ static struct backlight_properties riva_bl_data = { | |||
355 | static void riva_bl_set_power(struct fb_info *info, int power) | 355 | static void riva_bl_set_power(struct fb_info *info, int power) |
356 | { | 356 | { |
357 | mutex_lock(&info->bl_mutex); | 357 | mutex_lock(&info->bl_mutex); |
358 | up(&info->bl_dev->sem); | 358 | |
359 | info->bl_dev->props->power = power; | 359 | if (info->bl_dev) { |
360 | __riva_bl_update_status(info->bl_dev); | 360 | down(&info->bl_dev->sem); |
361 | 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 | |||
362 | mutex_unlock(&info->bl_mutex); | 366 | mutex_unlock(&info->bl_mutex); |
363 | } | 367 | } |
364 | 368 | ||
@@ -382,7 +386,7 @@ static void riva_bl_init(struct riva_par *par) | |||
382 | bd = backlight_device_register(name, par, &riva_bl_data); | 386 | bd = backlight_device_register(name, par, &riva_bl_data); |
383 | if (IS_ERR(bd)) { | 387 | if (IS_ERR(bd)) { |
384 | info->bl_dev = NULL; | 388 | info->bl_dev = NULL; |
385 | printk("riva: Backlight registration failed\n"); | 389 | printk(KERN_WARNING "riva: Backlight registration failed\n"); |
386 | goto error; | 390 | goto error; |
387 | } | 391 | } |
388 | 392 | ||
@@ -393,11 +397,11 @@ static void riva_bl_init(struct riva_par *par) | |||
393 | 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL); | 397 | 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL); |
394 | mutex_unlock(&info->bl_mutex); | 398 | mutex_unlock(&info->bl_mutex); |
395 | 399 | ||
396 | up(&bd->sem); | 400 | down(&bd->sem); |
397 | bd->props->brightness = riva_bl_data.max_brightness; | 401 | bd->props->brightness = riva_bl_data.max_brightness; |
398 | bd->props->power = FB_BLANK_UNBLANK; | 402 | bd->props->power = FB_BLANK_UNBLANK; |
399 | bd->props->update_status(bd); | 403 | bd->props->update_status(bd); |
400 | down(&bd->sem); | 404 | up(&bd->sem); |
401 | 405 | ||
402 | #ifdef CONFIG_PMAC_BACKLIGHT | 406 | #ifdef CONFIG_PMAC_BACKLIGHT |
403 | mutex_lock(&pmac_backlight_mutex); | 407 | mutex_lock(&pmac_backlight_mutex); |