diff mbox series

[02/10] usb: gadget: udc: gr: fix deferred probing

Message ID 20211021191437.8737-3-s.shtylyov@omp.ru (mailing list archive)
State Superseded
Headers show
Series Fix deferred probing in the USB host/gadget drivers | expand

Commit Message

Sergey Shtylyov Oct. 21, 2021, 7:14 p.m. UTC
The driver overrides the error codes (and also IRQ0) returned by
platform_get_irq() to -ENODEV, so if it returns -EPROBE_DEFER, the driver
will fail the probe permanently instead of the deferred probing. Switch to
propagating the error codes upstream, considering IRQ0 valid for simplicity
devm_request_threaded_irq() can always override that decision...

Fixes: 196800da39a1 ("usb: gadget: gr_udc: Use platform_get_irq instead of irq_of_parse_and_map")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
 drivers/usb/gadget/udc/gr_udc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/usb/gadget/udc/gr_udc.c b/drivers/usb/gadget/udc/gr_udc.c
index 4b35739d3695..4aa5246a77e5 100644
--- a/drivers/usb/gadget/udc/gr_udc.c
+++ b/drivers/usb/gadget/udc/gr_udc.c
@@ -2136,15 +2136,15 @@  static int gr_probe(struct platform_device *pdev)
 		return PTR_ERR(regs);
 
 	dev->irq = platform_get_irq(pdev, 0);
-	if (dev->irq <= 0)
-		return -ENODEV;
+	if (dev->irq < 0)
+		return dev->irq;
 
 	/* Some core configurations has separate irqs for IN and OUT events */
 	dev->irqi = platform_get_irq(pdev, 1);
 	if (dev->irqi > 0) {
 		dev->irqo = platform_get_irq(pdev, 2);
-		if (dev->irqo <= 0)
-			return -ENODEV;
+		if (dev->irqo < 0)
+			return dev->irqo;
 	} else {
 		dev->irqi = 0;
 	}