diff mbox series

[-next] media: tegra_cec: fix the return value handle for platform_get_irq()

Message ID 20230801135253.456322-1-ruanjinjie@huawei.com
State Accepted
Commit 74a5a66fb422759961d78a7751a1f0b6b06b80f6
Headers show
Series [-next] media: tegra_cec: fix the return value handle for platform_get_irq() | expand

Commit Message

Jinjie Ruan Aug. 1, 2023, 1:52 p.m. UTC
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>
---
 drivers/media/cec/platform/tegra/tegra_cec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Thierry Reding Oct. 10, 2023, 4:08 p.m. UTC | #1
On Tue, Aug 01, 2023 at 09:52:53PM +0800, Ruan Jinjie wrote:
> 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>
> ---
>  drivers/media/cec/platform/tegra/tegra_cec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Doesn't look like this has been applied yet. For the record:

Acked-by: Thierry Reding <treding@nvidia.com>
diff mbox series

Patch

diff --git a/drivers/media/cec/platform/tegra/tegra_cec.c b/drivers/media/cec/platform/tegra/tegra_cec.c
index 04dc06e3c42a..79811f2c1951 100644
--- a/drivers/media/cec/platform/tegra/tegra_cec.c
+++ b/drivers/media/cec/platform/tegra/tegra_cec.c
@@ -348,8 +348,8 @@  static int tegra_cec_probe(struct platform_device *pdev)
 
 	cec->tegra_cec_irq = platform_get_irq(pdev, 0);
 
-	if (cec->tegra_cec_irq <= 0)
-		return -EBUSY;
+	if (cec->tegra_cec_irq < 0)
+		return cec->tegra_cec_irq;
 
 	cec->cec_base = devm_ioremap(&pdev->dev, res->start,
 					     resource_size(res));