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-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
