diff mbox series

[-next,1/2] media: camif-core: Do not check for 0 return after calling platform_get_irq()

Message ID 20230803024645.2716057-2-ruanjinjie@huawei.com (mailing list archive)
State Accepted
Commit 384e83db20afaff8a4b7352ab6ff5c475283610b
Headers show
Series media: platform: Do not check for 0 return after calling platform_get_irq() | expand

Commit Message

Jinjie Ruan Aug. 3, 2023, 2:46 a.m. UTC
It is not possible for platform_get_irq() to return 0. Use the
return value from platform_get_irq().

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
---
 drivers/media/platform/samsung/s3c-camif/camif-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Andrzej Pietrasiewicz Aug. 3, 2023, 6:39 a.m. UTC | #1
W dniu 3.08.2023 o 04:46, Ruan Jinjie pisze:
> It is not possible for platform_get_irq() to return 0. Use the
> return value from platform_get_irq().
> 
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>

Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>

> ---
>   drivers/media/platform/samsung/s3c-camif/camif-core.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/samsung/s3c-camif/camif-core.c b/drivers/media/platform/samsung/s3c-camif/camif-core.c
> index afe1fcc37354..e4529f666e20 100644
> --- a/drivers/media/platform/samsung/s3c-camif/camif-core.c
> +++ b/drivers/media/platform/samsung/s3c-camif/camif-core.c
> @@ -381,8 +381,8 @@ static int camif_request_irqs(struct platform_device *pdev,
>   		init_waitqueue_head(&vp->irq_queue);
>   
>   		irq = platform_get_irq(pdev, i);
> -		if (irq <= 0)
> -			return -ENXIO;
> +		if (irq < 0)
> +			return irq;
>   
>   		ret = devm_request_irq(&pdev->dev, irq, s3c_camif_irq_handler,
>   				       0, dev_name(&pdev->dev), vp);
Andi Shyti Aug. 5, 2023, 9:40 p.m. UTC | #2
Hi Ruan,

On Thu, Aug 03, 2023 at 10:46:44AM +0800, Ruan Jinjie wrote:
> It is not possible for platform_get_irq() to return 0. Use the
> return value from platform_get_irq().
> 
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>

Reviewed-by: Andi Shyti <andi.shyti@kernel.org> 

Thanks,
Andi
diff mbox series

Patch

diff --git a/drivers/media/platform/samsung/s3c-camif/camif-core.c b/drivers/media/platform/samsung/s3c-camif/camif-core.c
index afe1fcc37354..e4529f666e20 100644
--- a/drivers/media/platform/samsung/s3c-camif/camif-core.c
+++ b/drivers/media/platform/samsung/s3c-camif/camif-core.c
@@ -381,8 +381,8 @@  static int camif_request_irqs(struct platform_device *pdev,
 		init_waitqueue_head(&vp->irq_queue);
 
 		irq = platform_get_irq(pdev, i);
-		if (irq <= 0)
-			return -ENXIO;
+		if (irq < 0)
+			return irq;
 
 		ret = devm_request_irq(&pdev->dev, irq, s3c_camif_irq_handler,
 				       0, dev_name(&pdev->dev), vp);