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 <[email protected]>
---
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