aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-04-14 04:09:29 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-04-30 06:57:29 -0400
commita513ad2d6de2dbf28465e4eae7d355a926944871 (patch)
tree52d35c2d27938a0cc931d6ecf0678fca5575bbc6
parentc150a2803d6df8d35e9d86236c256347e7e14bf6 (diff)
video: mmpfb: cleanup some static checker warnings in probe()
Sparse complains about using zero instead of NULL for pointers. Probably, if we enabled the warning, then GCC would complain about the unused initializers. I've just removed them. Smatch complains that we first check if "fbi" is NULL and then dereference it in the error handling. It turns out that "fbi" can't be NULL so I've removed the check. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/fbdev/mmp/fb/mmpfb.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/video/fbdev/mmp/fb/mmpfb.c b/drivers/video/fbdev/mmp/fb/mmpfb.c
index 7ab31eb76a8c..910fcc6ecece 100644
--- a/drivers/video/fbdev/mmp/fb/mmpfb.c
+++ b/drivers/video/fbdev/mmp/fb/mmpfb.c
@@ -554,8 +554,8 @@ static void fb_info_clear(struct fb_info *info)
554static int mmpfb_probe(struct platform_device *pdev) 554static int mmpfb_probe(struct platform_device *pdev)
555{ 555{
556 struct mmp_buffer_driver_mach_info *mi; 556 struct mmp_buffer_driver_mach_info *mi;
557 struct fb_info *info = 0; 557 struct fb_info *info;
558 struct mmpfb_info *fbi = 0; 558 struct mmpfb_info *fbi;
559 int ret, modes_num; 559 int ret, modes_num;
560 560
561 mi = pdev->dev.platform_data; 561 mi = pdev->dev.platform_data;
@@ -569,10 +569,6 @@ static int mmpfb_probe(struct platform_device *pdev)
569 if (info == NULL) 569 if (info == NULL)
570 return -ENOMEM; 570 return -ENOMEM;
571 fbi = info->par; 571 fbi = info->par;
572 if (!fbi) {
573 ret = -EINVAL;
574 goto failed;
575 }
576 572
577 /* init fb */ 573 /* init fb */
578 fbi->fb_info = info; 574 fbi->fb_info = info;
@@ -667,7 +663,6 @@ failed_free_buff:
667 fbi->fb_start_dma); 663 fbi->fb_start_dma);
668failed_destroy_mutex: 664failed_destroy_mutex:
669 mutex_destroy(&fbi->access_ok); 665 mutex_destroy(&fbi->access_ok);
670failed:
671 dev_err(fbi->dev, "mmp-fb: frame buffer device init failed\n"); 666 dev_err(fbi->dev, "mmp-fb: frame buffer device init failed\n");
672 667
673 framebuffer_release(info); 668 framebuffer_release(info);