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