Re: [PATCH v2] drm/bridge: tpd12s015: Fix irq registering in tpd12s015_probe
Hi YueHaibing On Mon, Nov 02, 2020 at 10:30:24PM +0800, YueHaibing wrote: > 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 > --- > v2: Add checking for >= 0 and update commit message Thanks, applied to drm-misc-next. Sam > --- > drivers/gpu/drm/bridge/ti-tpd12s015.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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(>dev, tpd->hpd_irq, NULL, > tpd12s015_hpd_isr, > IRQF_TRIGGER_RISING | > -- > 2.17.1 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2] drm/bridge: tpd12s015: Fix irq registering in tpd12s015_probe
On 02/11/2020 16:30, YueHaibing wrote: > 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 > --- > v2: Add checking for >= 0 and update commit message > --- > drivers/gpu/drm/bridge/ti-tpd12s015.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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(>dev, tpd->hpd_irq, NULL, > tpd12s015_hpd_isr, > IRQF_TRIGGER_RISING | > Reviewed-by: Tomi Valkeinen Tomi -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2] 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 --- v2: Add checking for >= 0 and update commit message --- drivers/gpu/drm/bridge/ti-tpd12s015.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(>dev, tpd->hpd_irq, NULL, tpd12s015_hpd_isr, IRQF_TRIGGER_RISING | -- 2.17.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2] drm/bridge: tpd12s015: Fix irq registering in tpd12s015_probe
Hi Yue, Thank you for the patch. On Mon, Nov 02, 2020 at 10:30:24PM +0800, YueHaibing wrote: > 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 Reviewed-by: Laurent Pinchart > --- > v2: Add checking for >= 0 and update commit message > --- > drivers/gpu/drm/bridge/ti-tpd12s015.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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(>dev, tpd->hpd_irq, NULL, > tpd12s015_hpd_isr, > IRQF_TRIGGER_RISING | -- Regards, Laurent Pinchart ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel