summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2020-11-02 17:30:24 +0300
committerSam Ravnborg <sam@ravnborg.org>2020-11-06 00:09:09 +0300
commitc2530cc9610d84a5a0118ba40d0f09309605047f (patch)
tree82f88f573dd2b7825d8030e0dc669955e78aa02b
parented794057b052b52af2c6642bf32e8d21c6fba69c (diff)
downloadlinux-c2530cc9610d84a5a0118ba40d0f09309605047f.tar.xz
drm/bridge: tpd12s015: Fix irq registering in tpd12s015_probe
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: cff5e6f7e83f ("drm/bridge: Add driver for the TI TPD12S015 HDMI level shifter") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20201102143024.26216-1-yuehaibing@huawei.com
-rw-r--r--drivers/gpu/drm/bridge/ti-tpd12s015.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/bridge/ti-tpd12s015.c b/drivers/gpu/drm/bridge/ti-tpd12s015.c
index 514cbf0eac75..e0e015243a60 100644
--- a/drivers/gpu/drm/bridge/ti-tpd12s015.c
+++ b/drivers/gpu/drm/bridge/ti-tpd12s015.c
@@ -160,7 +160,7 @@ static int tpd12s015_probe(struct platform_device *pdev)
/* Register the IRQ if the HPD GPIO is IRQ-capable. */
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,
tpd12s015_hpd_isr,
IRQF_TRIGGER_RISING |