From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@barebox.org>,
Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] usb: dwc3: imx8mp: check dev_request_mem_resource return with IS_ERR
Date: Tue, 22 Sep 2026 11:37:11 +0200 [thread overview]
Message-ID: <20260922093712.1895604-1-a.fatoum@pengutronix.de> (raw)
From: Ahmad Fatoum <a.fatoum@barebox.org>
dev_request_mem_resource() returns an ERR_PTR() and never NULL, so the
warning could never be printed and an error pointer would be used as
MMIO address. Fix this by using IS_ERR for the error check.
Fixes: 38923891e866 ("usb: dwc3: port Linux i.MX8MP glue driver")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/usb/dwc3/dwc3-imx8mp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c
index 6b6ceeaed471..d165b95a2eec 100644
--- a/drivers/usb/dwc3/dwc3-imx8mp.c
+++ b/drivers/usb/dwc3/dwc3-imx8mp.c
@@ -114,7 +114,7 @@ static int dwc3_imx8mp_probe(struct device *dev)
return PTR_ERR(dwc3_imx->hsio_blk_base);
res = dev_request_mem_resource(dev, 1);
- if (!res)
+ if (IS_ERR(res))
dev_warn(dev, "Base address for glue layer missing. Continuing without, some features are missing though.");
else
dwc3_imx->glue_base = IOMEM(res->start);
--
2.47.3
next reply other threads:[~2026-09-22 9:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 9:37 Ahmad Fatoum [this message]
2026-09-23 6:10 ` Sascha Hauer
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=20260922093712.1895604-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=a.fatoum@barebox.org \
--cc=barebox@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox