[PATCH] drm: msm: Fix error check return value of irq_of_parse_and_map()

Zhen Ni nizhen at uniontech.com
Thu Jan 5 08:33:06 UTC 2023


The irq_of_parse_and_map() function returns 0 on failure, and does not
return an negative value.

Signed-off-by: Zhen Ni <nizhen at uniontech.com>
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 89aadd3b3202..3891d9d4a602 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -1953,9 +1953,9 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi)
 	}
 
 	msm_host->irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
-	if (msm_host->irq < 0) {
-		ret = msm_host->irq;
-		dev_err(&pdev->dev, "failed to get irq: %d\n", ret);
+	if (!msm_host->irq) {
+		ret = -EINVAL;
+		dev_err(&pdev->dev, "failed to get irq\n");
 		return ret;
 	}
 
-- 
2.20.1



More information about the dri-devel mailing list