diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-09-04 16:31:36 +0200 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-09-04 16:31:36 +0200 |
commit | 31e77ac55f18db0ec1c724840927562ef3093ef6 (patch) | |
tree | 01bb0ac2868debd2246df4c5e5617a2ce9f09600 /drivers/video/nvidia/nv_backlight.c | |
parent | [GFS2] Tidy up locking code (diff) | |
parent | Linux 2.6.18-rc6 (diff) | |
download | linux-31e77ac55f18db0ec1c724840927562ef3093ef6.tar.xz linux-31e77ac55f18db0ec1c724840927562ef3093ef6.zip |
Merge branch 'master' into gfs2
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 = { void nvidia_bl_set_power(struct fb_info *info, int power) { mutex_lock(&info->bl_mutex); - up(&info->bl_dev->sem); - info->bl_dev->props->power = power; - __nvidia_bl_update_status(info->bl_dev); - down(&info->bl_dev->sem); + + if (info->bl_dev) { + down(&info->bl_dev->sem); + info->bl_dev->props->power = power; + __nvidia_bl_update_status(info->bl_dev); + up(&info->bl_dev->sem); + } + mutex_unlock(&info->bl_mutex); } @@ -140,7 +144,7 @@ void nvidia_bl_init(struct nvidia_par *par) bd = backlight_device_register(name, par, &nvidia_bl_data); if (IS_ERR(bd)) { info->bl_dev = NULL; - printk("nvidia: Backlight registration failed\n"); + printk(KERN_WARNING "nvidia: Backlight registration failed\n"); goto error; } @@ -151,11 +155,11 @@ void nvidia_bl_init(struct nvidia_par *par) 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL); mutex_unlock(&info->bl_mutex); - up(&bd->sem); + down(&bd->sem); bd->props->brightness = nvidia_bl_data.max_brightness; bd->props->power = FB_BLANK_UNBLANK; bd->props->update_status(bd); - down(&bd->sem); + up(&bd->sem); #ifdef CONFIG_PMAC_BACKLIGHT mutex_lock(&pmac_backlight_mutex); |