diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-10-04 11:09:53 +0300 |
---|---|---|
committer | Leo Yu-Chi Liang <ycliang@andestech.com> | 2022-10-20 10:22:15 +0300 |
commit | 72c1f5f282737156ef630db911979eeb16796522 (patch) | |
tree | 9b93f93c61dba5f0e73debe1610de726c0d96b0a | |
parent | 9487764e7e4f58a41fcfc4df7ae0db5fa4e4ffd8 (diff) | |
download | u-boot-72c1f5f282737156ef630db911979eeb16796522.tar.xz |
cmd/sbi: error message for failure to get spec version
If calling 'Get SBI specification version' fails, write an error message
and return CMD_RET_FAILURE.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Rick Chen <rick@andestech.com>
-rw-r--r-- | cmd/riscv/sbi.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd/riscv/sbi.c b/cmd/riscv/sbi.c index 9bbe7d4b90..24955d2be1 100644 --- a/cmd/riscv/sbi.c +++ b/cmd/riscv/sbi.c @@ -56,8 +56,11 @@ static int do_sbi(struct cmd_tbl *cmdtp, int flag, int argc, long mvendorid, marchid, mimpid; ret = sbi_get_spec_version(); - if (ret >= 0) - printf("SBI %ld.%ld", ret >> 24, ret & 0xffffff); + if (ret < 0) { + printf("No SBI 0.2+\n"); + return CMD_RET_FAILURE; + } + printf("SBI %ld.%ld", ret >> 24, ret & 0xffffff); impl_id = sbi_get_impl_id(); if (impl_id >= 0) { for (i = 0; i < ARRAY_SIZE(implementations); ++i) { |