Skip to content

Commit 2de5bdc

Browse files
Dan CarpenterChun-Kuang Hu
authored andcommitted
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: 8d0f798 ("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>
1 parent 8f0b4cc commit 2de5bdc

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/mediatek/mtk_hdmi_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, struct platform_device
303303
return dev_err_probe(dev, ret, "Failed to get clocks\n");
304304

305305
hdmi->irq = platform_get_irq(pdev, 0);
306-
if (!hdmi->irq)
306+
if (hdmi->irq < 0)
307307
return hdmi->irq;
308308

309309
hdmi->regs = device_node_to_regmap(dev->of_node);

drivers/gpu/drm/mediatek/mtk_hdmi_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ struct mtk_hdmi {
168168
bool audio_enable;
169169
bool powered;
170170
bool enabled;
171-
unsigned int irq;
171+
int irq;
172172
enum hdmi_hpd_state hpd;
173173
hdmi_codec_plugged_cb plugged_cb;
174174
struct device *codec_dev;

0 commit comments

Comments
 (0)