aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
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
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')
-rw-r--r--drivers/video/bf54x-lq043fb.c10
-rw-r--r--drivers/video/bfin-t350mcqb-fb.c10
2 files changed, 18 insertions, 2 deletions
diff --git a/drivers/video/bf54x-lq043fb.c b/drivers/video/bf54x-lq043fb.c
index 54df3d44af8f..23b2a8c0dbfc 100644
--- a/drivers/video/bf54x-lq043fb.c
+++ b/drivers/video/bf54x-lq043fb.c
@@ -433,7 +433,7 @@ static int bl_get_brightness(struct backlight_device *bd)
433 return 0; 433 return 0;
434} 434}
435 435
436static struct backlight_ops bfin_lq043fb_bl_ops = { 436static const struct backlight_ops bfin_lq043fb_bl_ops = {
437 .get_brightness = bl_get_brightness, 437 .get_brightness = bl_get_brightness,
438}; 438};
439 439
@@ -650,6 +650,12 @@ static int __devinit bfin_bf54x_probe(struct platform_device *pdev)
650 props.max_brightness = 255; 650 props.max_brightness = 255;
651 bl_dev = backlight_device_register("bf54x-bl", NULL, NULL, 651 bl_dev = backlight_device_register("bf54x-bl", NULL, NULL,
652 &bfin_lq043fb_bl_ops, &props); 652 &bfin_lq043fb_bl_ops, &props);
653 if (IS_ERR(bl_dev)) {
654 printk(KERN_ERR DRIVER_NAME
655 ": unable to register backlight.\n");
656 ret = -EINVAL;
657 goto out9;
658 }
653 659
654 lcd_dev = lcd_device_register(DRIVER_NAME, &pdev->dev, NULL, &bfin_lcd_ops); 660 lcd_dev = lcd_device_register(DRIVER_NAME, &pdev->dev, NULL, &bfin_lcd_ops);
655 lcd_dev->props.max_contrast = 255, printk(KERN_INFO "Done.\n"); 661 lcd_dev->props.max_contrast = 255, printk(KERN_INFO "Done.\n");
@@ -657,6 +663,8 @@ static int __devinit bfin_bf54x_probe(struct platform_device *pdev)
657 663
658 return 0; 664 return 0;
659 665
666out9:
667 unregister_framebuffer(fbinfo);
660out8: 668out8:
661 free_irq(info->irq, info); 669 free_irq(info->irq, info);
662out7: 670out7:
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: