]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/mediatek: Fix platform_get_irq() error checking
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 25 Nov 2025 13:52:39 +0000 (16:52 +0300)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Tue, 30 Dec 2025 15:35:45 +0000 (15:35 +0000)
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>
drivers/gpu/drm/mediatek/mtk_hdmi_common.c
drivers/gpu/drm/mediatek/mtk_hdmi_common.h

index e78eb0876f16e9b210b89c8f996bc70c6a5b6309..bd7f8c56ec9cecda79cf0caf35e02b43313a80ff 100644 (file)
@@ -303,7 +303,7 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, struct platform_device
                return dev_err_probe(dev, ret, "Failed to get clocks\n");
 
        hdmi->irq = platform_get_irq(pdev, 0);
-       if (!hdmi->irq)
+       if (hdmi->irq < 0)
                return hdmi->irq;
 
        hdmi->regs = device_node_to_regmap(dev->of_node);
index de5e064585f85d9eb2e447f2d18432513d60d2d8..7a644bbf5843d7a01ea0598111d68992d8190c31 100644 (file)
@@ -168,7 +168,7 @@ struct mtk_hdmi {
        bool audio_enable;
        bool powered;
        bool enabled;
-       unsigned int irq;
+       int irq;
        enum hdmi_hpd_state hpd;
        hdmi_codec_plugged_cb plugged_cb;
        struct device *codec_dev;