All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: <linux-usb@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Felipe Balbi <balbi@kernel.org>
Subject: [PATCH v3 1/6] usb: gadget: udc: gr: fix deferred probing
Date: Fri, 10 Dec 2021 23:46:29 +0300	[thread overview]
Message-ID: <20211210204634.8182-2-s.shtylyov@omp.ru> (raw)
In-Reply-To: <20211210204634.8182-1-s.shtylyov@omp.ru>

The driver overrides the error codes and 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. IRQ0 is no longer returned by platform_get_irq(), so we now
can safely ignore it...

Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
Changes in version 3:
- corrected the "Fixes:" tag.

Changes in version 2:
- updated the patch description on treating IRQ0.

 drivers/usb/gadget/udc/gr_udc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

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;
 	}
-- 
2.26.3


  reply	other threads:[~2021-12-10 20:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10 20:46 [PATCH v3 0/6] Fix deferred probing in the USB host/gadget drivers Sergey Shtylyov
2021-12-10 20:46 ` Sergey Shtylyov [this message]
2021-12-13 14:11   ` [PATCH v3 1/6] usb: gadget: udc: gr: fix deferred probing Greg Kroah-Hartman
2021-12-13 15:21     ` Sergey Shtylyov
2021-12-10 20:46 ` [PATCH v3 2/6] usb: host: ehci-atmel: " Sergey Shtylyov
2021-12-10 20:46   ` Sergey Shtylyov
2022-04-15 14:55   ` Nicolas Ferre
2022-04-15 14:55     ` Nicolas Ferre
2021-12-10 20:46 ` [PATCH v3 3/6] usb: host: ehci-orion: " Sergey Shtylyov
2021-12-10 20:46 ` [PATCH v3 4/6] usb: host: ohci-da8xx: " Sergey Shtylyov
2021-12-10 20:46 ` [PATCH v3 5/6] usb: host: ohci-nxp: " Sergey Shtylyov
2021-12-10 20:46 ` [PATCH v3 6/6] usb: musb: core: " Sergey Shtylyov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211210204634.8182-2-s.shtylyov@omp.ru \
    --to=s.shtylyov@omp.ru \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.