[PATCH master 3/3] RISC-V: cpu: 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/riscv/cpu/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/cpu/core.c b/arch/riscv/cpu/core.c
index ad9030ede78b..4889f774cbb3 100644
--- a/arch/riscv/cpu/core.c
+++ b/arch/riscv/cpu/core.c
@@ -28,7 +28,9 @@
 static int riscv_request_stack(void)
 {
 	extern unsigned long riscv_stack_top;
-	return PTR_ERR_OR_ZERO(request_barebox_region("stack", riscv_stack_top - STACK_SIZE, STACK_SIZE));
+	return request_barebox_region("stack",
+				      riscv_stack_top - STACK_SIZE,
+				      STACK_SIZE) ? 0 : -EINVAL;
 }
 coredevice_initcall(riscv_request_stack);
 
-- 
2.39.2





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

  Powered by Linux