* [PATCH] drm/msm/dsi: fix error check return value of irq_of_parse_and_map()
@ 2022-04-25 9:14 cgel.zte
0 siblings, 0 replies; only message in thread
From: cgel.zte @ 2022-04-25 9:14 UTC (permalink / raw)
To: benh, joel
Cc: brendanhiggins, tglx, maz, andrew, linux-i2c, openbmc,
linux-kernel, linux-arm-kernel, linux-aspeed, Lv Ruyi,
Zeal Robot
From: Lv Ruyi <lv.ruyi@zte.com.cn>
The irq_of_parse_and_map() function returns 0 on failure, and does not
return a negative value anyhow, so never enter this conditional branch.
Fixes: bf94ec093d0 ("drm/msm/dsi: do not enable irq handler before powering up the host")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
drivers/gpu/drm/msm/dsi/dsi_host.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index d51e70fab93d..29199e6e15ee 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -1873,10 +1873,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);
- return ret;
+ if (!msm_host->irq) {
+ dev_err(&pdev->dev, "failed to get irq\n");
+ return -EINVAL;
}
/* do not autoenable, will be enabled later */
--
2.25.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-04-25 9:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25 9:14 [PATCH] drm/msm/dsi: fix error check return value of irq_of_parse_and_map() cgel.zte
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).