Message ID | 4f3c5c98-04f7-43f7-900f-5d7482c83eef@moroto.mountain (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/msm/dsi: fix irq_of_parse_and_map() error checking | expand |
On 15.09.2023 14:59, Dan Carpenter wrote: > The irq_of_parse_and_map() function returns zero on error. It > never returns negative error codes. Fix the check. > > Fixes: a689554ba6ed ("drm/msm: Initial add DSI connector support") > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> > --- Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Nice catch! Konrad
On 9/15/2023 5:59 AM, Dan Carpenter wrote: > The irq_of_parse_and_map() function returns zero on error. It > never returns negative error codes. Fix the check. > > Fixes: a689554ba6ed ("drm/msm: Initial add DSI connector support") > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> > --- > drivers/gpu/drm/msm/dsi/dsi_host.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com> Will queue it up for -fixes
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 5d9ec27c89d3..13da53737a6a 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -1894,10 +1894,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 */
The irq_of_parse_and_map() function returns zero on error. It never returns negative error codes. Fix the check. Fixes: a689554ba6ed ("drm/msm: Initial add DSI connector support") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> --- drivers/gpu/drm/msm/dsi/dsi_host.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)