media: platform: ti: fix the return value handle for platform_get_irq()
authorRuan Jinjie <ruanjinjie@huawei.com>
Mon, 31 Jul 2023 12:02:12 +0000 (14:02 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 14 Aug 2023 18:27:55 +0000 (20:27 +0200)
There is no possible for platform_get_irq() to return 0,
and the return value of platform_get_irq() is more sensible
to show the error reason.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/ti/am437x/am437x-vpfe.c
drivers/media/platform/ti/omap3isp/isp.c

index 319ec5ea0527e5e7cfb18b10896127583c56ae17..63092013d476ef32e11cce1085eca04fafde9058 100644 (file)
@@ -2426,10 +2426,8 @@ static int vpfe_probe(struct platform_device *pdev)
        }
 
        ret = platform_get_irq(pdev, 0);
-       if (ret <= 0) {
-               ret = -ENODEV;
+       if (ret < 0)
                goto probe_out_cleanup;
-       }
        vpfe->irq = ret;
 
        ret = devm_request_irq(vpfe->pdev, vpfe->irq, vpfe_isr, 0,
index 52c480437ed254680e675b4cb173f22ae9af2c30..1cda23244c7bc70a8f3092ad9e434e2a0df31bb3 100644 (file)
@@ -2392,10 +2392,8 @@ static int isp_probe(struct platform_device *pdev)
 
        /* Interrupt */
        ret = platform_get_irq(pdev, 0);
-       if (ret <= 0) {
-               ret = -ENODEV;
+       if (ret < 0)
                goto error_iommu;
-       }
        isp->irq_num = ret;
 
        if (devm_request_irq(isp->dev, isp->irq_num, isp_isr, IRQF_SHARED,