From: Rosen Penev <rosenp@gmail.com>
To: Neill Kapron <nkapron@google.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] usb: gadget: udc: snps_udc_plat: use platform_get_irq for IRQ lookup
Date: Tue, 10 Nov 2026 18:32:21 -0800 [thread overview]
Message-ID: <20261111023221.70102-1-rosenp@gmail.com> (raw)
Replace irq_of_parse_and_map() with platform_get_irq() and move the
IRQ acquisition to the top of the probe function, before any resource
allocation. This provides proper error propagation including
-EPROBE_DEFER support and removes the need for a manual error message.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/usb/gadget/udc/snps_udc_plat.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/gadget/udc/snps_udc_plat.c b/drivers/usb/gadget/udc/snps_udc_plat.c
index 3687690ca33d..38aa077a56b5 100644
--- a/drivers/usb/gadget/udc/snps_udc_plat.c
+++ b/drivers/usb/gadget/udc/snps_udc_plat.c
@@ -102,8 +102,13 @@ static int udc_plat_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct resource *res;
struct udc *udc;
+ int irq;
int ret;
+ irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ return irq;
+
udc = devm_kzalloc_obj(dev, *udc);
if (!udc)
return -ENOMEM;
@@ -130,11 +135,7 @@ static int udc_plat_probe(struct platform_device *pdev)
udc->phys_addr = (unsigned long)res->start;
- udc->irq = irq_of_parse_and_map(dev->of_node, 0);
- if (udc->irq <= 0) {
- dev_err(dev, "Can't parse and map interrupt\n");
- return -EINVAL;
- }
+ udc->irq = irq;
udc->udc_phy = devm_of_phy_get_by_index(dev, dev->of_node, 0);
if (IS_ERR(udc->udc_phy)) {
--
2.56.0
reply other threads:[~2026-11-11 2:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261111023221.70102-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=nkapron@google.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®