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]/
Signed-off-by: Damon Ding <[email protected]>
---
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c 
b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 079f2f01f33b..27c9a764e25f 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1480,9 +1480,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,
-- 
2.34.1

Reply via email to