upstream: [media] blackfin: fix error return code in bcap_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 13 May 2013 07:52:16 +0000 (04:52 -0300)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:48:00 +0000 (11:48 +0900)
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/blackfin/bfin_capture.c

index 0e55b08..391d9a9 100644 (file)
@@ -960,7 +960,7 @@ static int bcap_probe(struct platform_device *pdev)
        int ret;
 
        config = pdev->dev.platform_data;
-       if (!config) {
+       if (!config || !config->num_inputs) {
                v4l2_err(pdev->dev.driver, "Unable to get board config\n");
                return -ENODEV;
        }
@@ -1067,11 +1067,6 @@ static int bcap_probe(struct platform_device *pdev)
                                                 NULL);
        if (bcap_dev->sd) {
                int i;
-               if (!config->num_inputs) {
-                       v4l2_err(&bcap_dev->v4l2_dev,
-                                       "Unable to work without input\n");
-                       goto err_unreg_vdev;
-               }
 
                /* update tvnorms from the sub devices */
                for (i = 0; i < config->num_inputs; i++)
@@ -1079,6 +1074,7 @@ static int bcap_probe(struct platform_device *pdev)
        } else {
                v4l2_err(&bcap_dev->v4l2_dev,
                                "Unable to register sub device\n");
+               ret = -ENODEV;
                goto err_unreg_vdev;
        }