[PATCH] usb: dwc3: imx8mp: check dev_request_mem_resource return with IS_ERR

Ahmad Fatoum a.fatoum at pengutronix.de
Tue Sep 22 02:37:11 PDT 2026


From: Ahmad Fatoum <a.fatoum at 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 at 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




More information about the barebox mailing list