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

drm/mediatek: Fix platform_get_irq() error checking

The platform_get_irq() function returns negative error codes on failure
and positive non-zero IRQ numbers on success. It never returns NULL. Fix
the error checking to look for negatives, and change "hdmi->irq" from
unsigned int to just int.

Fixes: 8d0f79886273 ("drm/mediatek: Introduce HDMI/DDC v2 for MT8195/MT8188")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
https://patchwork.kernel.org/project/dri-devel/patch/aSW0p5sqnJVJsqDO@stanley.mountain/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>

authored by

Dan Carpenter and committed by
Chun-Kuang Hu
2de5bdc2 8f0b4cce

+2 -2
+1 -1
drivers/gpu/drm/mediatek/mtk_hdmi_common.c
··· 303 303 return dev_err_probe(dev, ret, "Failed to get clocks\n"); 304 304 305 305 hdmi->irq = platform_get_irq(pdev, 0); 306 - if (!hdmi->irq) 306 + if (hdmi->irq < 0) 307 307 return hdmi->irq; 308 308 309 309 hdmi->regs = device_node_to_regmap(dev->of_node);
+1 -1
drivers/gpu/drm/mediatek/mtk_hdmi_common.h
··· 168 168 bool audio_enable; 169 169 bool powered; 170 170 bool enabled; 171 - unsigned int irq; 171 + int irq; 172 172 enum hdmi_hpd_state hpd; 173 173 hdmi_codec_plugged_cb plugged_cb; 174 174 struct device *codec_dev;