mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] usb: dwc3: imx8mp: check dev_request_mem_resource return with IS_ERR
@ 2026-09-22  9:37 Ahmad Fatoum
  2026-09-23  6:10 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2026-09-22  9:37 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum, Ahmad Fatoum

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: dwc3: imx8mp: check dev_request_mem_resource return with IS_ERR
  2026-09-22  9:37 [PATCH] usb: dwc3: imx8mp: check dev_request_mem_resource return with IS_ERR Ahmad Fatoum
@ 2026-09-23  6:10 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2026-09-23  6:10 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum; +Cc: Ahmad Fatoum


On Tue, 22 Sep 2026 11:37:11 +0200, Ahmad Fatoum wrote:
> 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.
> 
> 

Applied, thanks!

[1/1] usb: dwc3: imx8mp: check dev_request_mem_resource return with IS_ERR
      https://git.pengutronix.de/cgit/barebox/commit/?id=e005bdbb0441 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-23  6:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-22  9:37 [PATCH] usb: dwc3: imx8mp: check dev_request_mem_resource return with IS_ERR Ahmad Fatoum
2026-09-23  6:10 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox