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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux