diff mbox series

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

Message ID 20230803024645.2716057-3-ruanjinjie@huawei.com (mailing list archive)
State New, archived
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() or platform_get_irq_byname()
to return 0. Use the return value from platform_get_irq()
or platform_get_irq_byname().

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

Comments

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

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

> ---
>   drivers/media/platform/verisilicon/hantro_drv.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
> index 35ca71b19def..423fc85d79ee 100644
> --- a/drivers/media/platform/verisilicon/hantro_drv.c
> +++ b/drivers/media/platform/verisilicon/hantro_drv.c
> @@ -1085,8 +1085,8 @@ static int hantro_probe(struct platform_device *pdev)
>   			irq_name = "default";
>   			irq = platform_get_irq(vpu->pdev, 0);
>   		}
> -		if (irq <= 0)
> -			return -ENXIO;
> +		if (irq < 0)
> +			return irq;
>   
>   		ret = devm_request_irq(vpu->dev, irq,
>   				       vpu->variant->irqs[i].handler, 0,
Andi Shyti Aug. 5, 2023, 9:42 p.m. UTC | #2
Hi Ruan,

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

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

Andi
diff mbox series

Patch

diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
index 35ca71b19def..423fc85d79ee 100644
--- a/drivers/media/platform/verisilicon/hantro_drv.c
+++ b/drivers/media/platform/verisilicon/hantro_drv.c
@@ -1085,8 +1085,8 @@  static int hantro_probe(struct platform_device *pdev)
 			irq_name = "default";
 			irq = platform_get_irq(vpu->pdev, 0);
 		}
-		if (irq <= 0)
-			return -ENXIO;
+		if (irq < 0)
+			return irq;
 
 		ret = devm_request_irq(vpu->dev, irq,
 				       vpu->variant->irqs[i].handler, 0,