summaryrefslogtreecommitdiff
path: root/drivers/video/bf54x-lq043fb.c
diff options
context:
space:
mode:
authorBruno Prémont <bonbons@linux-vserver.org>2010-02-26 13:04:54 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-03-16 20:10:17 +0000
commitfa11de0a33e214a00e205494c27fb5a7bb71a5fa (patch)
treebed4af34b31f9e782159f3c2c17fe13817df52a9 /drivers/video/bf54x-lq043fb.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/bf54x-lq043fb.c')
-rw-r--r--drivers/video/bf54x-lq043fb.c10
1 files changed, 9 insertions, 1 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)
return 0;
}
-static struct backlight_ops bfin_lq043fb_bl_ops = {
+static const struct backlight_ops bfin_lq043fb_bl_ops = {
.get_brightness = bl_get_brightness,
};
@@ -650,6 +650,12 @@ static int __devinit bfin_bf54x_probe(struct platform_device *pdev)
props.max_brightness = 255;
bl_dev = backlight_device_register("bf54x-bl", NULL, NULL,
&bfin_lq043fb_bl_ops, &props);
+ if (IS_ERR(bl_dev)) {
+ printk(KERN_ERR DRIVER_NAME
+ ": unable to register backlight.\n");
+ ret = -EINVAL;
+ goto out9;
+ }
lcd_dev = lcd_device_register(DRIVER_NAME, &pdev->dev, NULL, &bfin_lcd_ops);
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)
return 0;
+out9:
+ unregister_framebuffer(fbinfo);
out8:
free_irq(info->irq, info);
out7: