diff mbox series

[05/10] usb: host: ehci-orion: fix deferred probing

Message ID 20211021191437.8737-6-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 -- that means we have to explicitly
filter out IRQ0 as bad since usb_add_hcd() doesn't quite like it... :-)

Fixes: e96ffe2f9deb ("USB: add Marvell Orion USB host support")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
 drivers/usb/host/ehci-orion.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
index 3626758b3e2a..4fa77883f901 100644
--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -222,8 +222,12 @@  static int ehci_orion_drv_probe(struct platform_device *pdev)
 	pr_debug("Initializing Orion-SoC USB Host Controller\n");
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
-		err = -ENODEV;
+	if (irq < 0) {
+		err = irq;
+		goto err;
+	}
+	if (!irq) {
+		err = -EINVAL;
 		goto err;
 	}