summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2021-10-15 16:42:21 +0300
committerAnup Patel <anup@brainfault.org>2021-10-18 13:37:21 +0300
commit67cbbcb100d321ec61f6424392562834083e9c98 (patch)
treeacf36afbfa2b654a9c2d9d9f141c3132c920fc41
parentc38973e0879e719d2b3ce1304802ea6b995d0d7e (diff)
downloadopensbi-67cbbcb100d321ec61f6424392562834083e9c98.tar.xz
lib: sbi: system reset with invalid parameters
The SBI specification requires that sbi_system_reset() returns SBI_ERR_INVALID_PARAM if reset_type or reset_reason are not valid. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Atish Patra <atish.patra@wdc.com> Reviewed-by: Xiang W <wxjstz@126.com>
-rw-r--r--lib/sbi/sbi_ecall_replace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sbi/sbi_ecall_replace.c b/lib/sbi/sbi_ecall_replace.c
index 5d24565..93f44da 100644
--- a/lib/sbi/sbi_ecall_replace.c
+++ b/lib/sbi/sbi_ecall_replace.c
@@ -151,7 +151,7 @@ static int sbi_ecall_srst_handler(unsigned long extid, unsigned long funcid,
case SBI_SRST_RESET_TYPE_WARM_REBOOT:
break;
default:
- return SBI_ENOTSUPP;
+ return SBI_EINVAL;
}
switch (regs->a1) {
@@ -159,7 +159,7 @@ static int sbi_ecall_srst_handler(unsigned long extid, unsigned long funcid,
case SBI_SRST_RESET_REASON_SYSFAIL:
break;
default:
- return SBI_ENOTSUPP;
+ return SBI_EINVAL;
}
if (sbi_system_reset_supported(regs->a0, regs->a1))