request_barebox_region returns NULL on error, so adjust the initcall
accordingly.

Signed-off-by: Ahmad Fatoum <a.fat...@pengutronix.de>
---
 arch/arm/mach-imx/scratch.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-imx/scratch.c b/arch/arm/mach-imx/scratch.c
index 002b499fab3a..b7280ff60952 100644
--- a/arch/arm/mach-imx/scratch.c
+++ b/arch/arm/mach-imx/scratch.c
@@ -95,8 +95,8 @@ const struct optee_header *imx_scratch_get_optee_hdr(void)
 
 static int imx8m_reserve_scratch_area(void)
 {
-       return PTR_ERR_OR_ZERO(request_barebox_region("scratch area",
-                                   (ulong)arm_mem_scratch_get(),
-                                   sizeof(struct imx_scratch_space)));
+       return request_barebox_region("scratch area",
+                                     (ulong)arm_mem_scratch_get(),
+                                     sizeof(struct imx_scratch_space)) ? 0 : 
-EINVAL;
 }
 device_initcall(imx8m_reserve_scratch_area);
-- 
2.39.2


Reply via email to