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