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

Reply via email to