lib: sbi: Align system suspend errors with spec
authorAndrew Jones <ajones@ventanamicro.com>
Thu, 1 Jun 2023 07:48:10 +0000 (09:48 +0200)
committerAnup Patel <anup@brainfault.org>
Sun, 4 Jun 2023 09:48:40 +0000 (15:18 +0530)
commitbdde2ecd27af1ac158669809f6658376fb5137ab
tree61a9aa92e7ac60ae573786394ffd9df4e8b48191
parentdf75e0995689842b3022a4a8d4d69e980430c129
lib: sbi: Align system suspend errors with spec

The spec says sbi_system_suspend() will return SBI_ERR_INVALID_PARAM
when "sleep_type is reserved or is platform-specific and unimplemented"
and SBI_ERR_NOT_SUPPORTED when sleep_type "is not reserved and is
implemented, but the platform does not support it due to one or more
missing dependencies." Ensure SBI_ERR_INVALID_PARAM is returned for
reserved sleep types and that the system suspend driver can choose
which of the two error types to return itself by returning an error
from its check function rather than a boolean.

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