Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/msm/dsi: fix irq_of_parse_and_map() error checking

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>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/557715/
Link: https://lore.kernel.org/r/4f3c5c98-04f7-43f7-900f-5d7482c83eef@moroto.mountain
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>

authored by

Dan Carpenter and committed by
Abhinav Kumar
6a1d4c79 ab483e3a

+3 -4
+3 -4
drivers/gpu/drm/msm/dsi/dsi_host.c
··· 1906 1906 } 1907 1907 1908 1908 msm_host->irq = irq_of_parse_and_map(pdev->dev.of_node, 0); 1909 - if (msm_host->irq < 0) { 1910 - ret = msm_host->irq; 1911 - dev_err(&pdev->dev, "failed to get irq: %d\n", ret); 1912 - return ret; 1909 + if (!msm_host->irq) { 1910 + dev_err(&pdev->dev, "failed to get irq\n"); 1911 + return -EINVAL; 1913 1912 } 1914 1913 1915 1914 /* do not autoenable, will be enabled later */