[PATCH master 2/3] ARM: i.MX8M: scratch: fix initcall return code on request_barebox_region error

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Jul 22 10:06:05 PDT 2024


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

Signed-off-by: Ahmad Fatoum <a.fatoum at 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




More information about the barebox mailing list