Currently only -ENXIO is checked for dp->irq from gpiod_to_irq(), which ignores other possible error codes like -EPROBE_DEFER, -ENOENT.
Check for any negative value instead, and propagate the actual error code rather than hardcoding -ENODEV. Reported-by: Sashiko <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Tested-by: Heiko Stuebner <[email protected]> Signed-off-by: Damon Ding <[email protected]> --- Changes in v4: - Add Tested-by tag. Changes in v5: - Change the type of &analogix_dp_device.irq from unsigned int to int to fix the dead dp->irq < 0 check, which broke the probe deferral for the HPD GPIO. (Sashiko) --- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 4 ++-- drivers/gpu/drm/bridge/analogix/analogix_dp_core.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index a3871f28b835..c40ab7419f08 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1519,9 +1519,9 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) irq_flags = IRQF_NO_AUTOEN; } - if (dp->irq == -ENXIO) { + if (dp->irq < 0) { dev_err(&pdev->dev, "failed to get irq\n"); - return ERR_PTR(-ENODEV); + return ERR_PTR(dp->irq); } ret = devm_request_threaded_irq(&pdev->dev, dp->irq, diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h index dc189f0b7a19..cc3466304531 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.h @@ -159,7 +159,7 @@ struct analogix_dp_device { struct drm_bridge bridge; struct drm_dp_aux aux; struct clk *clock; - unsigned int irq; + int irq; void __iomem *reg_base; struct video_info video_info; -- 2.34.1
