* [PATCH 00/14] tree-wide: check dev_remap_addr() for NULL
@ 2026-09-03 21:35 David Lechner
2026-09-03 21:35 ` [PATCH 01/14] power: pmic: mtk-pwrap: " David Lechner
` (13 more replies)
0 siblings, 14 replies; 17+ messages in thread
From: David Lechner @ 2026-09-03 21:35 UTC (permalink / raw)
To: Jaehoon Chung, Peng Fan, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Tom Rini,
Julien Masson, Bo-Chen Chen, Jerome Forissier, Daniel Schwierzeck,
Joe Hershberger, Christian Marangi, Yang Xiwen, Marek Vasut,
Bin Meng, Mattijs Korpershoek, Sjoerd Simons, Eugen Hristev,
Claudiu Beznea, Casey Connolly, Neil Armstrong, Sumit Garg,
Quentin Schulz, Kever Yang, Simon Glass, Chris Morgan, Ryan Chen,
Chia-Wei Wang, Aspeed BMC SW team, Joel Stanley, Dylan Hung,
Ilias Apalodimas
Cc: Macpaul Lin, u-boot, Stefan Roese, Bhupesh Sharma, u-boot-qcom,
David Lechner
We noticed a mistake in a few MediaTek drivers where we were checking
the return value of dev_remap_addr() and friends with IS_ERR(), but it
only ever returns NULL on failure.
Then we saw that we were not the only ones who did this. So here is a
series to clean it all up at once.
The return values are a bit inconsistent, but -EINVAL seems to be the most
common, so that is what is used in places that didn't already have a
specific error code or established convention in the file itself.
There were also a few cases that used IS_ERR_OR_NULL(), which isn't a
bug like IS_ERR(), but we clean them up too for correctness.
There are some places that don't check the return value, but I didn't
look into if those should be considered bugs or not.
Custodians: feel free to pick up any patches for your subsystem. And
I can take what is left through the MediaTek tree in a few weeks.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
David Lechner (14):
power: pmic: mtk-pwrap: check dev_remap_addr() for NULL
net: mt7628-eth: check dev_remap_addr_index() for NULL
net: airoha_eth: check dev_remap_addr_name() for NULL
net: hifemac: check dev_remap_addr_name() for NULL
net: hifemac_mdio: check dev_remap_addr() for NULL
usb: dwc3-octeon-glue: check dev_remap_addr() for NULL
usb: dwc3-am62: check dev_remap_addr_index() for NULL
timer: mchp-pit64b: check dev_read_addr_ptr() for NULL
phy: qcom: snps-femto-v2: check dev_read_addr_ptr() for NULL
phy: rockchip: inno-dsidphy: check dev_read_addr_ptr() for NULL
pinctrl: aspeed: ast2600: check dev_read_addr_ptr() for NULL
reset: ast2500: check dev_read_addr_ptr() for NULL
reset: ast2600: check dev_read_addr_ptr() for NULL
arm: aspeed: ast2600: check devfdt_get_addr_ptr() for NULL
arch/arm/mach-aspeed/ast2600/board_common.c | 3 +--
arch/arm/mach-aspeed/ast2600/spl.c | 3 +--
drivers/net/airoha_eth.c | 4 ++--
drivers/net/hifemac.c | 2 +-
drivers/net/hifemac_mdio.c | 9 ++++-----
drivers/net/mt7628-eth.c | 10 +++++-----
drivers/phy/qcom/phy-qcom-snps-femto-v2.c | 5 +++--
drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c | 5 +++--
drivers/pinctrl/aspeed/pinctrl_ast2600.c | 5 ++---
drivers/power/pmic/mtk-pwrap.c | 4 ++--
drivers/reset/reset-ast2500.c | 4 ++--
drivers/reset/reset-ast2600.c | 4 ++--
drivers/timer/mchp-pit64b-timer.c | 4 ++--
drivers/usb/dwc3/dwc3-am62.c | 2 +-
drivers/usb/host/dwc3-octeon-glue.c | 5 ++---
15 files changed, 33 insertions(+), 36 deletions(-)
---
base-commit: 1c5004ffc5e3f000eca6cada32af7c83bd925c2b
change-id: 20260903-b4-dm-addr-null-checks-85b1450fa045
Best regards,
--
David Lechner <dlechner@baylibre.com>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 01/14] power: pmic: mtk-pwrap: check dev_remap_addr() for NULL
2026-09-03 21:35 [PATCH 00/14] tree-wide: check dev_remap_addr() for NULL David Lechner
@ 2026-09-03 21:35 ` David Lechner
2026-09-03 21:35 ` [PATCH 02/14] net: mt7628-eth: check dev_remap_addr_index() " David Lechner
` (12 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: David Lechner @ 2026-09-03 21:35 UTC (permalink / raw)
To: Jaehoon Chung, Peng Fan, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Tom Rini,
Julien Masson, Bo-Chen Chen, Jerome Forissier, Daniel Schwierzeck,
Joe Hershberger, Christian Marangi, Yang Xiwen, Marek Vasut,
Bin Meng, Mattijs Korpershoek, Sjoerd Simons, Eugen Hristev,
Claudiu Beznea, Casey Connolly, Neil Armstrong, Sumit Garg,
Quentin Schulz, Kever Yang, Simon Glass, Chris Morgan, Ryan Chen,
Chia-Wei Wang, Aspeed BMC SW team, Joel Stanley, Dylan Hung,
Ilias Apalodimas
Cc: Macpaul Lin, u-boot, Stefan Roese, Bhupesh Sharma, u-boot-qcom,
David Lechner
Check the return value of dev_remap_addr() for NULL instead of
IS_ERR(). This function only ever returns NULL on failure.
Fixes: 219c05f3f68e ("power: pmic: mtk-pwrap: add MediaTek PMIC Wrapper driver")
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/power/pmic/mtk-pwrap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/power/pmic/mtk-pwrap.c b/drivers/power/pmic/mtk-pwrap.c
index 21cf4ed6a8f..f23061de386 100644
--- a/drivers/power/pmic/mtk-pwrap.c
+++ b/drivers/power/pmic/mtk-pwrap.c
@@ -712,8 +712,8 @@ static int mtk_pwrap_probe(struct udevice *dev)
wrp->dev = dev;
wrp->base = dev_remap_addr(dev);
- if (IS_ERR(wrp->base))
- return PTR_ERR(wrp->base);
+ if (!wrp->base)
+ return -EINVAL;
wrp->master = (void *)dev_get_driver_data(dev);
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 02/14] net: mt7628-eth: check dev_remap_addr_index() for NULL
2026-09-03 21:35 [PATCH 00/14] tree-wide: check dev_remap_addr() for NULL David Lechner
2026-09-03 21:35 ` [PATCH 01/14] power: pmic: mtk-pwrap: " David Lechner
@ 2026-09-03 21:35 ` David Lechner
2026-09-03 21:35 ` [PATCH 03/14] net: airoha_eth: check dev_remap_addr_name() " David Lechner
` (11 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: David Lechner @ 2026-09-03 21:35 UTC (permalink / raw)
To: Jaehoon Chung, Peng Fan, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Tom Rini,
Julien Masson, Bo-Chen Chen, Jerome Forissier, Daniel Schwierzeck,
Joe Hershberger, Christian Marangi, Yang Xiwen, Marek Vasut,
Bin Meng, Mattijs Korpershoek, Sjoerd Simons, Eugen Hristev,
Claudiu Beznea, Casey Connolly, Neil Armstrong, Sumit Garg,
Quentin Schulz, Kever Yang, Simon Glass, Chris Morgan, Ryan Chen,
Chia-Wei Wang, Aspeed BMC SW team, Joel Stanley, Dylan Hung,
Ilias Apalodimas
Cc: Macpaul Lin, u-boot, Stefan Roese, Bhupesh Sharma, u-boot-qcom,
David Lechner
Check the return value of dev_remap_addr_index() for NULL instead of
IS_ERR(). This function only ever returns NULL on failure.
Replace the now-unused <linux/err.h> include with <errno.h>,
which is what actually provides the error codes this driver uses.
Fixes: c895ef465059 ("net: Add MT7628 ethernet driver")
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/net/mt7628-eth.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/mt7628-eth.c b/drivers/net/mt7628-eth.c
index fc8a6bb331b..fc99320af20 100644
--- a/drivers/net/mt7628-eth.c
+++ b/drivers/net/mt7628-eth.c
@@ -15,6 +15,7 @@
#include <cpu_func.h>
#include <dm.h>
+#include <errno.h>
#include <log.h>
#include <malloc.h>
#include <miiphy.h>
@@ -26,7 +27,6 @@
#include <linux/bitfield.h>
#include <linux/bitops.h>
#include <linux/delay.h>
-#include <linux/err.h>
#include <linux/printk.h>
/* Ethernet frame engine register */
@@ -562,13 +562,13 @@ static int mt7628_eth_probe(struct udevice *dev)
/* Save frame-engine base address for later use */
priv->base = dev_remap_addr_index(dev, 0);
- if (IS_ERR(priv->base))
- return PTR_ERR(priv->base);
+ if (!priv->base)
+ return -EINVAL;
/* Save switch base address for later use */
priv->eth_sw_base = dev_remap_addr_index(dev, 1);
- if (IS_ERR(priv->eth_sw_base))
- return PTR_ERR(priv->eth_sw_base);
+ if (!priv->eth_sw_base)
+ return -EINVAL;
/* Reset controller */
ret = reset_get_by_name(dev, "ephy", &priv->rst_ephy);
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 03/14] net: airoha_eth: check dev_remap_addr_name() for NULL
2026-09-03 21:35 [PATCH 00/14] tree-wide: check dev_remap_addr() for NULL David Lechner
2026-09-03 21:35 ` [PATCH 01/14] power: pmic: mtk-pwrap: " David Lechner
2026-09-03 21:35 ` [PATCH 02/14] net: mt7628-eth: check dev_remap_addr_index() " David Lechner
@ 2026-09-03 21:35 ` David Lechner
2026-09-03 21:35 ` [PATCH 04/14] net: hifemac: " David Lechner
` (10 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: David Lechner @ 2026-09-03 21:35 UTC (permalink / raw)
To: Jaehoon Chung, Peng Fan, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Tom Rini,
Julien Masson, Bo-Chen Chen, Jerome Forissier, Daniel Schwierzeck,
Joe Hershberger, Christian Marangi, Yang Xiwen, Marek Vasut,
Bin Meng, Mattijs Korpershoek, Sjoerd Simons, Eugen Hristev,
Claudiu Beznea, Casey Connolly, Neil Armstrong, Sumit Garg,
Quentin Schulz, Kever Yang, Simon Glass, Chris Morgan, Ryan Chen,
Chia-Wei Wang, Aspeed BMC SW team, Joel Stanley, Dylan Hung,
Ilias Apalodimas
Cc: Macpaul Lin, u-boot, Stefan Roese, Bhupesh Sharma, u-boot-qcom,
David Lechner
Check the return value of dev_remap_addr_name() for NULL instead of
IS_ERR(). This function only ever returns NULL on failure.
Fixes: 74fcb6a7a7e9 ("net: airoha: Add Airoha Ethernet driver")
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/net/airoha_eth.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/airoha_eth.c b/drivers/net/airoha_eth.c
index e5d39b95cc5..ac72df5b660 100644
--- a/drivers/net/airoha_eth.c
+++ b/drivers/net/airoha_eth.c
@@ -687,8 +687,8 @@ static int airoha_qdma_init(struct udevice *dev,
qdma->eth = eth;
qdma->regs = dev_remap_addr_name(dev, "qdma0");
- if (IS_ERR(qdma->regs))
- return PTR_ERR(qdma->regs);
+ if (!qdma->regs)
+ return -ENOMEM;
err = airoha_qdma_init_rx(qdma);
if (err)
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 04/14] net: hifemac: check dev_remap_addr_name() for NULL
2026-09-03 21:35 [PATCH 00/14] tree-wide: check dev_remap_addr() for NULL David Lechner
` (2 preceding siblings ...)
2026-09-03 21:35 ` [PATCH 03/14] net: airoha_eth: check dev_remap_addr_name() " David Lechner
@ 2026-09-03 21:35 ` David Lechner
2026-09-03 21:35 ` [PATCH 05/14] net: hifemac_mdio: check dev_remap_addr() " David Lechner
` (9 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: David Lechner @ 2026-09-03 21:35 UTC (permalink / raw)
To: Jaehoon Chung, Peng Fan, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Tom Rini,
Julien Masson, Bo-Chen Chen, Jerome Forissier, Daniel Schwierzeck,
Joe Hershberger, Christian Marangi, Yang Xiwen, Marek Vasut,
Bin Meng, Mattijs Korpershoek, Sjoerd Simons, Eugen Hristev,
Claudiu Beznea, Casey Connolly, Neil Armstrong, Sumit Garg,
Quentin Schulz, Kever Yang, Simon Glass, Chris Morgan, Ryan Chen,
Chia-Wei Wang, Aspeed BMC SW team, Joel Stanley, Dylan Hung,
Ilias Apalodimas
Cc: Macpaul Lin, u-boot, Stefan Roese, Bhupesh Sharma, u-boot-qcom,
David Lechner
Check the return value of dev_remap_addr_name() for NULL instead of
IS_ERR(). This function only ever returns NULL on failure.
Fixes: 9d8f78a2a79f ("net: add hifemac Ethernet driver for HiSilicon platform")
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/net/hifemac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/hifemac.c b/drivers/net/hifemac.c
index 7dda8cb8815..ed983e0b263 100644
--- a/drivers/net/hifemac.c
+++ b/drivers/net/hifemac.c
@@ -435,7 +435,7 @@ static int hisi_femac_of_to_plat(struct udevice *dev)
}
priv->glb_base = dev_remap_addr_name(dev, "glb");
- if (IS_ERR(priv->glb_base)) {
+ if (!priv->glb_base) {
dev_err(dev, "Failed to remap global address space\n");
return log_msg_ret("net", -EINVAL);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 05/14] net: hifemac_mdio: check dev_remap_addr() for NULL
2026-09-03 21:35 [PATCH 00/14] tree-wide: check dev_remap_addr() for NULL David Lechner
` (3 preceding siblings ...)
2026-09-03 21:35 ` [PATCH 04/14] net: hifemac: " David Lechner
@ 2026-09-03 21:35 ` David Lechner
2026-09-03 21:35 ` [PATCH 06/14] usb: dwc3-octeon-glue: " David Lechner
` (8 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: David Lechner @ 2026-09-03 21:35 UTC (permalink / raw)
To: Jaehoon Chung, Peng Fan, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Tom Rini,
Julien Masson, Bo-Chen Chen, Jerome Forissier, Daniel Schwierzeck,
Joe Hershberger, Christian Marangi, Yang Xiwen, Marek Vasut,
Bin Meng, Mattijs Korpershoek, Sjoerd Simons, Eugen Hristev,
Claudiu Beznea, Casey Connolly, Neil Armstrong, Sumit Garg,
Quentin Schulz, Kever Yang, Simon Glass, Chris Morgan, Ryan Chen,
Chia-Wei Wang, Aspeed BMC SW team, Joel Stanley, Dylan Hung,
Ilias Apalodimas
Cc: Macpaul Lin, u-boot, Stefan Roese, Bhupesh Sharma, u-boot-qcom,
David Lechner
Check the return value of dev_remap_addr() for NULL instead of
IS_ERR(). This function only ever returns NULL on failure.
Add <errno.h>, since this is the first error code used directly
in this file.
Fixes: 6b5c8d98e204 ("net: add hifemac_mdio MDIO bus driver for HiSilicon platform")
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/net/hifemac_mdio.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/net/hifemac_mdio.c b/drivers/net/hifemac_mdio.c
index 0b59d060917..6d30ad2031c 100644
--- a/drivers/net/hifemac_mdio.c
+++ b/drivers/net/hifemac_mdio.c
@@ -7,6 +7,7 @@
#include <dm.h>
#include <clk.h>
+#include <errno.h>
#include <miiphy.h>
#include <dm/device_compat.h>
#include <linux/io.h>
@@ -70,13 +71,11 @@ static int hisi_femac_mdio_write(struct udevice *dev, int addr, int devad, int r
static int hisi_femac_mdio_of_to_plat(struct udevice *dev)
{
struct hisi_femac_mdio_data *data = dev_get_priv(dev);
- int ret;
data->membase = dev_remap_addr(dev);
- if (IS_ERR(data->membase)) {
- ret = PTR_ERR(data->membase);
- dev_err(dev, "Failed to remap base addr %d\n", ret);
- return log_msg_ret("mdio", ret);
+ if (!data->membase) {
+ dev_err(dev, "Failed to remap base addr\n");
+ return log_msg_ret("mdio", -EINVAL);
}
// clk is optional
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 06/14] usb: dwc3-octeon-glue: check dev_remap_addr() for NULL
2026-09-03 21:35 [PATCH 00/14] tree-wide: check dev_remap_addr() for NULL David Lechner
` (4 preceding siblings ...)
2026-09-03 21:35 ` [PATCH 05/14] net: hifemac_mdio: check dev_remap_addr() " David Lechner
@ 2026-09-03 21:35 ` David Lechner
2026-09-04 11:54 ` Mattijs Korpershoek
2026-09-03 21:35 ` [PATCH 07/14] usb: dwc3-am62: check dev_remap_addr_index() " David Lechner
` (7 subsequent siblings)
13 siblings, 1 reply; 17+ messages in thread
From: David Lechner @ 2026-09-03 21:35 UTC (permalink / raw)
To: Jaehoon Chung, Peng Fan, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Tom Rini,
Julien Masson, Bo-Chen Chen, Jerome Forissier, Daniel Schwierzeck,
Joe Hershberger, Christian Marangi, Yang Xiwen, Marek Vasut,
Bin Meng, Mattijs Korpershoek, Sjoerd Simons, Eugen Hristev,
Claudiu Beznea, Casey Connolly, Neil Armstrong, Sumit Garg,
Quentin Schulz, Kever Yang, Simon Glass, Chris Morgan, Ryan Chen,
Chia-Wei Wang, Aspeed BMC SW team, Joel Stanley, Dylan Hung,
Ilias Apalodimas
Cc: Macpaul Lin, u-boot, Stefan Roese, Bhupesh Sharma, u-boot-qcom,
David Lechner
Check the return value of dev_remap_addr() for NULL instead of
IS_ERR(). This function only ever returns NULL on failure.
Drop the now-unused <linux/err.h> include.
Fixes: 92ca2fee08d5 ("usb: xhci: octeon: Add DWC3 glue layer for Octeon")
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/usb/host/dwc3-octeon-glue.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/host/dwc3-octeon-glue.c b/drivers/usb/host/dwc3-octeon-glue.c
index 975f375e15a..39f2e70e47d 100644
--- a/drivers/usb/host/dwc3-octeon-glue.c
+++ b/drivers/usb/host/dwc3-octeon-glue.c
@@ -19,7 +19,6 @@
#include <dm/of_access.h>
#include <linux/bitfield.h>
#include <linux/delay.h>
-#include <linux/err.h>
#include <linux/io.h>
#include <linux/usb/dwc3.h>
#include <linux/usb/otg.h>
@@ -351,8 +350,8 @@ static int octeon_dwc3_glue_probe(struct udevice *dev)
void __iomem *base;
base = dev_remap_addr(dev);
- if (IS_ERR(base))
- return PTR_ERR(base);
+ if (!base)
+ return -EINVAL;
dwc3_octeon_clocks_start(dev, base);
dwc3_octeon_set_endian_mode(base);
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 07/14] usb: dwc3-am62: check dev_remap_addr_index() for NULL
2026-09-03 21:35 [PATCH 00/14] tree-wide: check dev_remap_addr() for NULL David Lechner
` (5 preceding siblings ...)
2026-09-03 21:35 ` [PATCH 06/14] usb: dwc3-octeon-glue: " David Lechner
@ 2026-09-03 21:35 ` David Lechner
2026-09-04 11:54 ` Mattijs Korpershoek
2026-09-03 21:35 ` [PATCH 08/14] timer: mchp-pit64b: check dev_read_addr_ptr() " David Lechner
` (6 subsequent siblings)
13 siblings, 1 reply; 17+ messages in thread
From: David Lechner @ 2026-09-03 21:35 UTC (permalink / raw)
To: Jaehoon Chung, Peng Fan, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Tom Rini,
Julien Masson, Bo-Chen Chen, Jerome Forissier, Daniel Schwierzeck,
Joe Hershberger, Christian Marangi, Yang Xiwen, Marek Vasut,
Bin Meng, Mattijs Korpershoek, Sjoerd Simons, Eugen Hristev,
Claudiu Beznea, Casey Connolly, Neil Armstrong, Sumit Garg,
Quentin Schulz, Kever Yang, Simon Glass, Chris Morgan, Ryan Chen,
Chia-Wei Wang, Aspeed BMC SW team, Joel Stanley, Dylan Hung,
Ilias Apalodimas
Cc: Macpaul Lin, u-boot, Stefan Roese, Bhupesh Sharma, u-boot-qcom,
David Lechner
Check the return value of dev_remap_addr_index() for NULL instead of
IS_ERR(). This function only ever returns NULL on failure.
Fixes: 92114d7c0a19 ("usb: dwc3: Add dwc3 glue driver for am62")
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/usb/dwc3/dwc3-am62.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
index 8cb5796b6ad..57a34d69fbe 100644
--- a/drivers/usb/dwc3/dwc3-am62.c
+++ b/drivers/usb/dwc3/dwc3-am62.c
@@ -46,7 +46,7 @@ static void dwc3_ti_am62_glue_configure(struct udevice *dev, int index,
struct ofnode_phandle_args args;
usbss = dev_remap_addr_index(dev, 0);
- if (IS_ERR(usbss)) {
+ if (!usbss) {
dev_err(dev, "can't map IOMEM resource\n");
return;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 08/14] timer: mchp-pit64b: check dev_read_addr_ptr() for NULL
2026-09-03 21:35 [PATCH 00/14] tree-wide: check dev_remap_addr() for NULL David Lechner
` (6 preceding siblings ...)
2026-09-03 21:35 ` [PATCH 07/14] usb: dwc3-am62: check dev_remap_addr_index() " David Lechner
@ 2026-09-03 21:35 ` David Lechner
2026-09-03 21:35 ` [PATCH 09/14] phy: qcom: snps-femto-v2: " David Lechner
` (5 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: David Lechner @ 2026-09-03 21:35 UTC (permalink / raw)
To: Jaehoon Chung, Peng Fan, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Tom Rini,
Julien Masson, Bo-Chen Chen, Jerome Forissier, Daniel Schwierzeck,
Joe Hershberger, Christian Marangi, Yang Xiwen, Marek Vasut,
Bin Meng, Mattijs Korpershoek, Sjoerd Simons, Eugen Hristev,
Claudiu Beznea, Casey Connolly, Neil Armstrong, Sumit Garg,
Quentin Schulz, Kever Yang, Simon Glass, Chris Morgan, Ryan Chen,
Chia-Wei Wang, Aspeed BMC SW team, Joel Stanley, Dylan Hung,
Ilias Apalodimas
Cc: Macpaul Lin, u-boot, Stefan Roese, Bhupesh Sharma, u-boot-qcom,
David Lechner
Check the return value of dev_read_addr_ptr() for NULL instead of
IS_ERR(). This function only ever returns NULL on failure.
Fixes: ed1b726683e7 ("timer: mchp-pit64b: add support for pit64b")
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/timer/mchp-pit64b-timer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/timer/mchp-pit64b-timer.c b/drivers/timer/mchp-pit64b-timer.c
index 1a5b2e6a0dc..117236d51e7 100644
--- a/drivers/timer/mchp-pit64b-timer.c
+++ b/drivers/timer/mchp-pit64b-timer.c
@@ -45,8 +45,8 @@ static int mchp_pit64b_probe(struct udevice *dev)
int ret;
priv->base = dev_read_addr_ptr(dev);
- if (IS_ERR(priv->base))
- return PTR_ERR(priv->base);
+ if (!priv->base)
+ return -EINVAL;
ret = clk_get_by_index(dev, 0, &clk);
if (ret)
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 09/14] phy: qcom: snps-femto-v2: check dev_read_addr_ptr() for NULL
2026-09-03 21:35 [PATCH 00/14] tree-wide: check dev_remap_addr() for NULL David Lechner
` (7 preceding siblings ...)
2026-09-03 21:35 ` [PATCH 08/14] timer: mchp-pit64b: check dev_read_addr_ptr() " David Lechner
@ 2026-09-03 21:35 ` David Lechner
2026-09-03 21:35 ` [PATCH 10/14] phy: rockchip: inno-dsidphy: " David Lechner
` (4 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: David Lechner @ 2026-09-03 21:35 UTC (permalink / raw)
To: Jaehoon Chung, Peng Fan, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Tom Rini,
Julien Masson, Bo-Chen Chen, Jerome Forissier, Daniel Schwierzeck,
Joe Hershberger, Christian Marangi, Yang Xiwen, Marek Vasut,
Bin Meng, Mattijs Korpershoek, Sjoerd Simons, Eugen Hristev,
Claudiu Beznea, Casey Connolly, Neil Armstrong, Sumit Garg,
Quentin Schulz, Kever Yang, Simon Glass, Chris Morgan, Ryan Chen,
Chia-Wei Wang, Aspeed BMC SW team, Joel Stanley, Dylan Hung,
Ilias Apalodimas
Cc: Macpaul Lin, u-boot, Stefan Roese, Bhupesh Sharma, u-boot-qcom,
David Lechner
Check the return value of dev_read_addr_ptr() for NULL instead of
IS_ERR(). This function only ever returns NULL on failure.
Add <errno.h>, since this is the first error code used directly
in this file.
Fixes: 968f512e6c9f ("phy: qcom: Add SNPS femto v2 USB HS phy")
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/phy/qcom/phy-qcom-snps-femto-v2.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/qcom/phy-qcom-snps-femto-v2.c b/drivers/phy/qcom/phy-qcom-snps-femto-v2.c
index e782de07ebc..bf1f16e4a22 100644
--- a/drivers/phy/qcom/phy-qcom-snps-femto-v2.c
+++ b/drivers/phy/qcom/phy-qcom-snps-femto-v2.c
@@ -9,6 +9,7 @@
#include <dm.h>
#include <dm/device_compat.h>
#include <dm/devres.h>
+#include <errno.h>
#include <generic-phy.h>
#include <malloc.h>
#include <reset.h>
@@ -165,8 +166,8 @@ static int qcom_snps_hsphy_phy_probe(struct udevice *dev)
int ret;
priv->base = dev_read_addr_ptr(dev);
- if (IS_ERR(priv->base))
- return PTR_ERR(priv->base);
+ if (!priv->base)
+ return -EINVAL;
ret = reset_get_bulk(dev, &priv->resets);
if (ret < 0) {
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 10/14] phy: rockchip: inno-dsidphy: check dev_read_addr_ptr() for NULL
2026-09-03 21:35 [PATCH 00/14] tree-wide: check dev_remap_addr() for NULL David Lechner
` (8 preceding siblings ...)
2026-09-03 21:35 ` [PATCH 09/14] phy: qcom: snps-femto-v2: " David Lechner
@ 2026-09-03 21:35 ` David Lechner
2026-09-03 21:35 ` [PATCH 11/14] pinctrl: aspeed: ast2600: " David Lechner
` (3 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: David Lechner @ 2026-09-03 21:35 UTC (permalink / raw)
To: Jaehoon Chung, Peng Fan, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Tom Rini,
Julien Masson, Bo-Chen Chen, Jerome Forissier, Daniel Schwierzeck,
Joe Hershberger, Christian Marangi, Yang Xiwen, Marek Vasut,
Bin Meng, Mattijs Korpershoek, Sjoerd Simons, Eugen Hristev,
Claudiu Beznea, Casey Connolly, Neil Armstrong, Sumit Garg,
Quentin Schulz, Kever Yang, Simon Glass, Chris Morgan, Ryan Chen,
Chia-Wei Wang, Aspeed BMC SW team, Joel Stanley, Dylan Hung,
Ilias Apalodimas
Cc: Macpaul Lin, u-boot, Stefan Roese, Bhupesh Sharma, u-boot-qcom,
David Lechner
Check the return value of dev_read_addr_ptr() for NULL instead of
IS_ERR(). This function only ever returns NULL on failure.
Add <errno.h>, since this is the first error code used directly
in this file.
Fixes: bf57dd5889be ("drivers: phy: add Innosilicon DSI-DPHY driver")
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
index 5be76e05339..9aaca8a50e3 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
@@ -9,6 +9,7 @@
#include <dm/device_compat.h>
#include <dm/devres.h>
#include <div64.h>
+#include <errno.h>
#include <generic-phy.h>
#include <linux/kernel.h>
#include <linux/iopoll.h>
@@ -625,8 +626,8 @@ static int inno_dsidphy_probe(struct udevice *dev)
inno->pdata = (const struct inno_video_phy_plat_data *)dev_get_driver_data(dev);
inno->phy_base = dev_read_addr_ptr(dev);
- if (IS_ERR(inno->phy_base))
- return PTR_ERR(inno->phy_base);
+ if (!inno->phy_base)
+ return -EINVAL;
inno->ref_clk = devm_clk_get(dev, "ref");
if (IS_ERR(inno->ref_clk)) {
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 11/14] pinctrl: aspeed: ast2600: check dev_read_addr_ptr() for NULL
2026-09-03 21:35 [PATCH 00/14] tree-wide: check dev_remap_addr() for NULL David Lechner
` (9 preceding siblings ...)
2026-09-03 21:35 ` [PATCH 10/14] phy: rockchip: inno-dsidphy: " David Lechner
@ 2026-09-03 21:35 ` David Lechner
2026-09-03 21:35 ` [PATCH 12/14] reset: ast2500: " David Lechner
` (2 subsequent siblings)
13 siblings, 0 replies; 17+ messages in thread
From: David Lechner @ 2026-09-03 21:35 UTC (permalink / raw)
To: Jaehoon Chung, Peng Fan, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Tom Rini,
Julien Masson, Bo-Chen Chen, Jerome Forissier, Daniel Schwierzeck,
Joe Hershberger, Christian Marangi, Yang Xiwen, Marek Vasut,
Bin Meng, Mattijs Korpershoek, Sjoerd Simons, Eugen Hristev,
Claudiu Beznea, Casey Connolly, Neil Armstrong, Sumit Garg,
Quentin Schulz, Kever Yang, Simon Glass, Chris Morgan, Ryan Chen,
Chia-Wei Wang, Aspeed BMC SW team, Joel Stanley, Dylan Hung,
Ilias Apalodimas
Cc: Macpaul Lin, u-boot, Stefan Roese, Bhupesh Sharma, u-boot-qcom,
David Lechner
Check the return value of dev_read_addr_ptr() for NULL instead of
IS_ERR(). This function only ever returns NULL on failure.
Drop the now-unused <linux/err.h> include.
Fixes: 46220bf0174d ("aspeed: AST2600 Pinctrl Driver")
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/pinctrl/aspeed/pinctrl_ast2600.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/pinctrl/aspeed/pinctrl_ast2600.c b/drivers/pinctrl/aspeed/pinctrl_ast2600.c
index f4bec6fe53c..af3eeacba51 100644
--- a/drivers/pinctrl/aspeed/pinctrl_ast2600.c
+++ b/drivers/pinctrl/aspeed/pinctrl_ast2600.c
@@ -10,7 +10,6 @@
#include <dm.h>
#include <dm/pinctrl.h>
#include <linux/bitops.h>
-#include <linux/err.h>
/*
* This driver works with very simple configuration that has the same name
@@ -46,8 +45,8 @@ static int ast2600_pinctrl_probe(struct udevice *dev)
return ret;
priv->scu = dev_read_addr_ptr(clk_dev);
- if (IS_ERR(priv->scu))
- return PTR_ERR(priv->scu);
+ if (!priv->scu)
+ return -EINVAL;
return 0;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 12/14] reset: ast2500: check dev_read_addr_ptr() for NULL
2026-09-03 21:35 [PATCH 00/14] tree-wide: check dev_remap_addr() for NULL David Lechner
` (10 preceding siblings ...)
2026-09-03 21:35 ` [PATCH 11/14] pinctrl: aspeed: ast2600: " David Lechner
@ 2026-09-03 21:35 ` David Lechner
2026-09-03 21:35 ` [PATCH 13/14] reset: ast2600: " David Lechner
2026-09-03 21:35 ` [PATCH 14/14] arm: aspeed: ast2600: check devfdt_get_addr_ptr() " David Lechner
13 siblings, 0 replies; 17+ messages in thread
From: David Lechner @ 2026-09-03 21:35 UTC (permalink / raw)
To: Jaehoon Chung, Peng Fan, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Tom Rini,
Julien Masson, Bo-Chen Chen, Jerome Forissier, Daniel Schwierzeck,
Joe Hershberger, Christian Marangi, Yang Xiwen, Marek Vasut,
Bin Meng, Mattijs Korpershoek, Sjoerd Simons, Eugen Hristev,
Claudiu Beznea, Casey Connolly, Neil Armstrong, Sumit Garg,
Quentin Schulz, Kever Yang, Simon Glass, Chris Morgan, Ryan Chen,
Chia-Wei Wang, Aspeed BMC SW team, Joel Stanley, Dylan Hung,
Ilias Apalodimas
Cc: Macpaul Lin, u-boot, Stefan Roese, Bhupesh Sharma, u-boot-qcom,
David Lechner
Check the return value of dev_read_addr_ptr() for NULL instead of
IS_ERR_OR_NULL(). This function only ever returns NULL on failure.
Replace the now-unused <linux/err.h> include with <errno.h>, which
is what actually provides the error code this driver uses.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/reset/reset-ast2500.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/reset/reset-ast2500.c b/drivers/reset/reset-ast2500.c
index c85906bbeb5..e7b4bb18cf4 100644
--- a/drivers/reset/reset-ast2500.c
+++ b/drivers/reset/reset-ast2500.c
@@ -5,11 +5,11 @@
*/
#include <dm.h>
+#include <errno.h>
#include <log.h>
#include <misc.h>
#include <reset.h>
#include <reset-uclass.h>
-#include <linux/err.h>
#include <asm/io.h>
#include <asm/arch/scu_ast2500.h>
@@ -78,7 +78,7 @@ static int ast2500_reset_probe(struct udevice *dev)
}
priv->scu = dev_read_addr_ptr(scu_dev);
- if (IS_ERR_OR_NULL(priv->scu)) {
+ if (!priv->scu) {
debug("%s: invalid SCU base pointer\n", __func__);
return -EINVAL;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 13/14] reset: ast2600: check dev_read_addr_ptr() for NULL
2026-09-03 21:35 [PATCH 00/14] tree-wide: check dev_remap_addr() for NULL David Lechner
` (11 preceding siblings ...)
2026-09-03 21:35 ` [PATCH 12/14] reset: ast2500: " David Lechner
@ 2026-09-03 21:35 ` David Lechner
2026-09-03 21:35 ` [PATCH 14/14] arm: aspeed: ast2600: check devfdt_get_addr_ptr() " David Lechner
13 siblings, 0 replies; 17+ messages in thread
From: David Lechner @ 2026-09-03 21:35 UTC (permalink / raw)
To: Jaehoon Chung, Peng Fan, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Tom Rini,
Julien Masson, Bo-Chen Chen, Jerome Forissier, Daniel Schwierzeck,
Joe Hershberger, Christian Marangi, Yang Xiwen, Marek Vasut,
Bin Meng, Mattijs Korpershoek, Sjoerd Simons, Eugen Hristev,
Claudiu Beznea, Casey Connolly, Neil Armstrong, Sumit Garg,
Quentin Schulz, Kever Yang, Simon Glass, Chris Morgan, Ryan Chen,
Chia-Wei Wang, Aspeed BMC SW team, Joel Stanley, Dylan Hung,
Ilias Apalodimas
Cc: Macpaul Lin, u-boot, Stefan Roese, Bhupesh Sharma, u-boot-qcom,
David Lechner
Check the return value of dev_read_addr_ptr() for NULL instead of
IS_ERR_OR_NULL(). This function only ever returns NULL on failure.
Replace the now-unused <linux/err.h> include with <errno.h>, which
is what actually provides the error code this driver uses.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/reset/reset-ast2600.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/reset/reset-ast2600.c b/drivers/reset/reset-ast2600.c
index 71b6220225a..46aaaf54119 100644
--- a/drivers/reset/reset-ast2600.c
+++ b/drivers/reset/reset-ast2600.c
@@ -4,11 +4,11 @@
*/
#include <dm.h>
+#include <errno.h>
#include <log.h>
#include <misc.h>
#include <reset.h>
#include <reset-uclass.h>
-#include <linux/err.h>
#include <asm/io.h>
#include <asm/arch/scu_ast2600.h>
@@ -77,7 +77,7 @@ static int ast2600_reset_probe(struct udevice *dev)
}
priv->scu = dev_read_addr_ptr(scu_dev);
- if (IS_ERR_OR_NULL(priv->scu)) {
+ if (!priv->scu) {
debug("%s: invalid SCU base pointer\n", __func__);
return -EINVAL;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 14/14] arm: aspeed: ast2600: check devfdt_get_addr_ptr() for NULL
2026-09-03 21:35 [PATCH 00/14] tree-wide: check dev_remap_addr() for NULL David Lechner
` (12 preceding siblings ...)
2026-09-03 21:35 ` [PATCH 13/14] reset: ast2600: " David Lechner
@ 2026-09-03 21:35 ` David Lechner
13 siblings, 0 replies; 17+ messages in thread
From: David Lechner @ 2026-09-03 21:35 UTC (permalink / raw)
To: Jaehoon Chung, Peng Fan, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Tom Rini,
Julien Masson, Bo-Chen Chen, Jerome Forissier, Daniel Schwierzeck,
Joe Hershberger, Christian Marangi, Yang Xiwen, Marek Vasut,
Bin Meng, Mattijs Korpershoek, Sjoerd Simons, Eugen Hristev,
Claudiu Beznea, Casey Connolly, Neil Armstrong, Sumit Garg,
Quentin Schulz, Kever Yang, Simon Glass, Chris Morgan, Ryan Chen,
Chia-Wei Wang, Aspeed BMC SW team, Joel Stanley, Dylan Hung,
Ilias Apalodimas
Cc: Macpaul Lin, u-boot, Stefan Roese, Bhupesh Sharma, u-boot-qcom,
David Lechner
Check the return value of devfdt_get_addr_ptr() for NULL instead of
IS_ERR_OR_NULL(). This function only ever returns NULL on failure.
Drop the now-unused <linux/err.h> include.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
arch/arm/mach-aspeed/ast2600/board_common.c | 3 +--
arch/arm/mach-aspeed/ast2600/spl.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-aspeed/ast2600/board_common.c b/arch/arm/mach-aspeed/ast2600/board_common.c
index 4c0b705ea88..652eaa1c286 100644
--- a/arch/arm/mach-aspeed/ast2600/board_common.c
+++ b/arch/arm/mach-aspeed/ast2600/board_common.c
@@ -9,7 +9,6 @@
#include <asm/io.h>
#include <asm/arch/timer.h>
#include <linux/bitops.h>
-#include <linux/err.h>
#include <dm/uclass.h>
#include <asm/arch/scu_ast2600.h>
#include <asm/global_data.h>
@@ -81,7 +80,7 @@ void board_add_ram_info(int use_default)
}
scu = devfdt_get_addr_ptr(scu_dev);
- if (IS_ERR_OR_NULL(scu)) {
+ if (!scu) {
debug("%s: cannot get SCU address pointer\n", __func__);
return;
}
diff --git a/arch/arm/mach-aspeed/ast2600/spl.c b/arch/arm/mach-aspeed/ast2600/spl.c
index 60f2c5d291e..e5813fb2b3e 100644
--- a/arch/arm/mach-aspeed/ast2600/spl.c
+++ b/arch/arm/mach-aspeed/ast2600/spl.c
@@ -6,7 +6,6 @@
#include <dm.h>
#include <spl.h>
#include <init.h>
-#include <linux/err.h>
#include <asm/io.h>
#include <asm/arch/scu_ast2600.h>
@@ -36,7 +35,7 @@ u32 spl_boot_device(void)
}
scu = devfdt_get_addr_ptr(scu_dev);
- if (IS_ERR_OR_NULL(scu)) {
+ if (!scu) {
debug("%s: failed to get SCU base\n", __func__);
goto out;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 06/14] usb: dwc3-octeon-glue: check dev_remap_addr() for NULL
2026-09-03 21:35 ` [PATCH 06/14] usb: dwc3-octeon-glue: " David Lechner
@ 2026-09-04 11:54 ` Mattijs Korpershoek
0 siblings, 0 replies; 17+ messages in thread
From: Mattijs Korpershoek @ 2026-09-04 11:54 UTC (permalink / raw)
To: David Lechner, Jaehoon Chung, Peng Fan, Ryder Lee, Weijie Gao,
Chunfeng Yun, Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream,
Tom Rini, Julien Masson, Bo-Chen Chen, Jerome Forissier,
Daniel Schwierzeck, Joe Hershberger, Christian Marangi,
Yang Xiwen, Marek Vasut, Bin Meng, Sjoerd Simons, Eugen Hristev,
Claudiu Beznea, Casey Connolly, Neil Armstrong, Sumit Garg,
Quentin Schulz, Kever Yang, Simon Glass, Chris Morgan, Ryan Chen,
Chia-Wei Wang, Aspeed BMC SW team, Joel Stanley, Dylan Hung,
Ilias Apalodimas
Cc: Macpaul Lin, u-boot, Stefan Roese, Bhupesh Sharma, u-boot-qcom,
David Lechner
Hi David,
Thank you for the patch.
On Thu, Sep 03, 2026 at 16:35, David Lechner <dlechner@baylibre.com> wrote:
> Check the return value of dev_remap_addr() for NULL instead of
> IS_ERR(). This function only ever returns NULL on failure.
>
> Drop the now-unused <linux/err.h> include.
>
> Fixes: 92ca2fee08d5 ("usb: xhci: octeon: Add DWC3 glue layer for Octeon")
> Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
> drivers/usb/host/dwc3-octeon-glue.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/host/dwc3-octeon-glue.c b/drivers/usb/host/dwc3-octeon-glue.c
> index 975f375e15a..39f2e70e47d 100644
> --- a/drivers/usb/host/dwc3-octeon-glue.c
> +++ b/drivers/usb/host/dwc3-octeon-glue.c
> @@ -19,7 +19,6 @@
> #include <dm/of_access.h>
> #include <linux/bitfield.h>
> #include <linux/delay.h>
> -#include <linux/err.h>
> #include <linux/io.h>
> #include <linux/usb/dwc3.h>
> #include <linux/usb/otg.h>
> @@ -351,8 +350,8 @@ static int octeon_dwc3_glue_probe(struct udevice *dev)
> void __iomem *base;
>
> base = dev_remap_addr(dev);
> - if (IS_ERR(base))
> - return PTR_ERR(base);
> + if (!base)
> + return -EINVAL;
>
> dwc3_octeon_clocks_start(dev, base);
> dwc3_octeon_set_endian_mode(base);
>
> --
> 2.43.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 07/14] usb: dwc3-am62: check dev_remap_addr_index() for NULL
2026-09-03 21:35 ` [PATCH 07/14] usb: dwc3-am62: check dev_remap_addr_index() " David Lechner
@ 2026-09-04 11:54 ` Mattijs Korpershoek
0 siblings, 0 replies; 17+ messages in thread
From: Mattijs Korpershoek @ 2026-09-04 11:54 UTC (permalink / raw)
To: David Lechner, Jaehoon Chung, Peng Fan, Ryder Lee, Weijie Gao,
Chunfeng Yun, Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream,
Tom Rini, Julien Masson, Bo-Chen Chen, Jerome Forissier,
Daniel Schwierzeck, Joe Hershberger, Christian Marangi,
Yang Xiwen, Marek Vasut, Bin Meng, Sjoerd Simons, Eugen Hristev,
Claudiu Beznea, Casey Connolly, Neil Armstrong, Sumit Garg,
Quentin Schulz, Kever Yang, Simon Glass, Chris Morgan, Ryan Chen,
Chia-Wei Wang, Aspeed BMC SW team, Joel Stanley, Dylan Hung,
Ilias Apalodimas
Cc: Macpaul Lin, u-boot, Stefan Roese, Bhupesh Sharma, u-boot-qcom,
David Lechner
Hi David,
Thank you for the patch.
On Thu, Sep 03, 2026 at 16:35, David Lechner <dlechner@baylibre.com> wrote:
> Check the return value of dev_remap_addr_index() for NULL instead of
> IS_ERR(). This function only ever returns NULL on failure.
>
> Fixes: 92114d7c0a19 ("usb: dwc3: Add dwc3 glue driver for am62")
> Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
> drivers/usb/dwc3/dwc3-am62.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
> index 8cb5796b6ad..57a34d69fbe 100644
> --- a/drivers/usb/dwc3/dwc3-am62.c
> +++ b/drivers/usb/dwc3/dwc3-am62.c
> @@ -46,7 +46,7 @@ static void dwc3_ti_am62_glue_configure(struct udevice *dev, int index,
> struct ofnode_phandle_args args;
>
> usbss = dev_remap_addr_index(dev, 0);
> - if (IS_ERR(usbss)) {
> + if (!usbss) {
> dev_err(dev, "can't map IOMEM resource\n");
> return;
> }
>
> --
> 2.43.0
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2026-09-04 13:08 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 21:35 [PATCH 00/14] tree-wide: check dev_remap_addr() for NULL David Lechner
2026-09-03 21:35 ` [PATCH 01/14] power: pmic: mtk-pwrap: " David Lechner
2026-09-03 21:35 ` [PATCH 02/14] net: mt7628-eth: check dev_remap_addr_index() " David Lechner
2026-09-03 21:35 ` [PATCH 03/14] net: airoha_eth: check dev_remap_addr_name() " David Lechner
2026-09-03 21:35 ` [PATCH 04/14] net: hifemac: " David Lechner
2026-09-03 21:35 ` [PATCH 05/14] net: hifemac_mdio: check dev_remap_addr() " David Lechner
2026-09-03 21:35 ` [PATCH 06/14] usb: dwc3-octeon-glue: " David Lechner
2026-09-04 11:54 ` Mattijs Korpershoek
2026-09-03 21:35 ` [PATCH 07/14] usb: dwc3-am62: check dev_remap_addr_index() " David Lechner
2026-09-04 11:54 ` Mattijs Korpershoek
2026-09-03 21:35 ` [PATCH 08/14] timer: mchp-pit64b: check dev_read_addr_ptr() " David Lechner
2026-09-03 21:35 ` [PATCH 09/14] phy: qcom: snps-femto-v2: " David Lechner
2026-09-03 21:35 ` [PATCH 10/14] phy: rockchip: inno-dsidphy: " David Lechner
2026-09-03 21:35 ` [PATCH 11/14] pinctrl: aspeed: ast2600: " David Lechner
2026-09-03 21:35 ` [PATCH 12/14] reset: ast2500: " David Lechner
2026-09-03 21:35 ` [PATCH 13/14] reset: ast2600: " David Lechner
2026-09-03 21:35 ` [PATCH 14/14] arm: aspeed: ast2600: check devfdt_get_addr_ptr() " David Lechner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox