aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/bfin-t350mcqb-fb.c
diff options
context:
space:
mode:
authorBruno Prémont <bonbons@linux-vserver.org>2010-02-26 07:04:54 -0500
committerRichard Purdie <rpurdie@linux.intel.com>2010-03-16 16:10:17 -0400
commitfa11de0a33e214a00e205494c27fb5a7bb71a5fa (patch)
treebed4af34b31f9e782159f3c2c17fe13817df52a9 /drivers/video/bfin-t350mcqb-fb.c
parentf0af78991363d704694a3618b638662c97d8a110 (diff)
backlight: blackfin - Fix missing registration failure handling
Check newly registered backlight_device for error and properly return error to parent Mark struct backlight_ops as const. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Acked-by: Mike Frysinger <vapier@gentoo.org> (constify struct backlight_ops) Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'drivers/video/bfin-t350mcqb-fb.c')
-rw-r--r--drivers/video/bfin-t350mcqb-fb.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/video/bfin-t350mcqb-fb.c b/drivers/video/bfin-t350mcqb-fb.c
index 3a8e811a7e9f..31a2dec927bb 100644
--- a/drivers/video/bfin-t350mcqb-fb.c
+++ b/drivers/video/bfin-t350mcqb-fb.c
@@ -352,7 +352,7 @@ static int bl_get_brightness(struct backlight_device *bd)
352 return 0; 352 return 0;
353} 353}
354 354
355static struct backlight_ops bfin_lq043fb_bl_ops = { 355static const struct backlight_ops bfin_lq043fb_bl_ops = {
356 .get_brightness = bl_get_brightness, 356 .get_brightness = bl_get_brightness,
357}; 357};
358 358
@@ -545,6 +545,12 @@ static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev)
545 props.max_brightness = 255; 545 props.max_brightness = 255;
546 bl_dev = backlight_device_register("bf52x-bl", NULL, NULL, 546 bl_dev = backlight_device_register("bf52x-bl", NULL, NULL,
547 &bfin_lq043fb_bl_ops, &props); 547 &bfin_lq043fb_bl_ops, &props);
548 if (IS_ERR(bl_dev)) {
549 printk(KERN_ERR DRIVER_NAME
550 ": unable to register backlight.\n");
551 ret = -EINVAL;
552 goto out9;
553 }
548 554
549 lcd_dev = lcd_device_register(DRIVER_NAME, NULL, &bfin_lcd_ops); 555 lcd_dev = lcd_device_register(DRIVER_NAME, NULL, &bfin_lcd_ops);
550 lcd_dev->props.max_contrast = 255, printk(KERN_INFO "Done.\n"); 556 lcd_dev->props.max_contrast = 255, printk(KERN_INFO "Done.\n");
@@ -552,6 +558,8 @@ static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev)
552 558
553 return 0; 559 return 0;
554 560
561out9:
562 unregister_framebuffer(fbinfo);
555out8: 563out8:
556 free_irq(info->irq, info); 564 free_irq(info->irq, info);
557out7: 565out7: