提交 bb6437df 编写于 作者: Y YueHaibing 提交者: Xie XiuQi

drm/bridge: tpd12s015: Fix irq registering in tpd12s015_probe

stable inclusion
from stable-5.10.4
commit 6ed6e024e3bb58332af0840b2658bc4252978ea4
bugzilla: 46903

--------------------------------

[ Upstream commit c2530cc9 ]

gpiod_to_irq() return negative value in case of error,
the existing code doesn't handle negative error codes.
If the HPD gpio supports IRQs (gpiod_to_irq returns a
valid number), we use the IRQ. If it doesn't (gpiod_to_irq
returns an error), it gets polled via detect().

Fixes: cff5e6f7 ("drm/bridge: Add driver for the TI TPD12S015 HDMI level shifter")
Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20201102143024.26216-1-yuehaibing@huawei.comSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 70bf46c6
...@@ -160,7 +160,7 @@ static int tpd12s015_probe(struct platform_device *pdev) ...@@ -160,7 +160,7 @@ static int tpd12s015_probe(struct platform_device *pdev)
/* Register the IRQ if the HPD GPIO is IRQ-capable. */ /* Register the IRQ if the HPD GPIO is IRQ-capable. */
tpd->hpd_irq = gpiod_to_irq(tpd->hpd_gpio); tpd->hpd_irq = gpiod_to_irq(tpd->hpd_gpio);
if (tpd->hpd_irq) { if (tpd->hpd_irq >= 0) {
ret = devm_request_threaded_irq(&pdev->dev, tpd->hpd_irq, NULL, ret = devm_request_threaded_irq(&pdev->dev, tpd->hpd_irq, NULL,
tpd12s015_hpd_isr, tpd12s015_hpd_isr,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_RISING |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册