lib: sbi_hsm: Ensure errors are consistent with spec
authorAndrew Jones <ajones@ventanamicro.com>
Mon, 27 Feb 2023 10:30:58 +0000 (11:30 +0100)
committerAnup Patel <anup@brainfault.org>
Mon, 27 Feb 2023 14:06:58 +0000 (19:36 +0530)
commitc88e039ec23c41ad0769c6714f60904f89fa3a5d
tree61506a80008c78b322535bdb253c6ef8491cb66d
parent40f16a81d33d70b113645fc9dc5071a74267e613
lib: sbi_hsm: Ensure errors are consistent with spec

HSM functions define when SBI_ERR_INVALID_PARAM should be returned.
Ensure it's not used for reasons that don't meet the definitions by
using the catch-all code, SBI_ERR_FAILED, for those reasons instead.
Also, in one case sbi_hart_suspend() may have returned SBI_ERR_DENIED,
which isn't defined for that function at all. Use SBI_ERR_FAILED for
that case too.

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
lib/sbi/sbi_hsm.c