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>
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) {