diff options
Diffstat (limited to 'drivers/video/riva/fbdev.c')
-rw-r--r-- | drivers/video/riva/fbdev.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c index d94c57ffbdb1..618f36bec10d 100644 --- a/drivers/video/riva/fbdev.c +++ b/drivers/video/riva/fbdev.c | |||
@@ -338,6 +338,7 @@ static struct backlight_ops riva_bl_ops = { | |||
338 | 338 | ||
339 | static void riva_bl_init(struct riva_par *par) | 339 | static void riva_bl_init(struct riva_par *par) |
340 | { | 340 | { |
341 | struct backlight_properties props; | ||
341 | struct fb_info *info = pci_get_drvdata(par->pdev); | 342 | struct fb_info *info = pci_get_drvdata(par->pdev); |
342 | struct backlight_device *bd; | 343 | struct backlight_device *bd; |
343 | char name[12]; | 344 | char name[12]; |
@@ -353,7 +354,10 @@ static void riva_bl_init(struct riva_par *par) | |||
353 | 354 | ||
354 | snprintf(name, sizeof(name), "rivabl%d", info->node); | 355 | snprintf(name, sizeof(name), "rivabl%d", info->node); |
355 | 356 | ||
356 | bd = backlight_device_register(name, info->dev, par, &riva_bl_ops); | 357 | memset(&props, 0, sizeof(struct backlight_properties)); |
358 | props.max_brightness = FB_BACKLIGHT_LEVELS - 1; | ||
359 | bd = backlight_device_register(name, info->dev, par, &riva_bl_ops, | ||
360 | &props); | ||
357 | if (IS_ERR(bd)) { | 361 | if (IS_ERR(bd)) { |
358 | info->bl_dev = NULL; | 362 | info->bl_dev = NULL; |
359 | printk(KERN_WARNING "riva: Backlight registration failed\n"); | 363 | printk(KERN_WARNING "riva: Backlight registration failed\n"); |
@@ -365,7 +369,6 @@ static void riva_bl_init(struct riva_par *par) | |||
365 | MIN_LEVEL * FB_BACKLIGHT_MAX / MAX_LEVEL, | 369 | MIN_LEVEL * FB_BACKLIGHT_MAX / MAX_LEVEL, |
366 | FB_BACKLIGHT_MAX); | 370 | FB_BACKLIGHT_MAX); |
367 | 371 | ||
368 | bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1; | ||
369 | bd->props.brightness = bd->props.max_brightness; | 372 | bd->props.brightness = bd->props.max_brightness; |
370 | bd->props.power = FB_BLANK_UNBLANK; | 373 | bd->props.power = FB_BLANK_UNBLANK; |
371 | backlight_update_status(bd); | 374 | backlight_update_status(bd); |