vboot: update vboot2 functions to use new vb2_error_t

To make explicit when vboot2 error codes should be returned,
use the new vb2_error_t type on all functions which return
VB2_ERROR_* constants.

BUG=b:124141368, chromium:988410
TEST=make clean && make runtests
BRANCH=none

Change-Id: Idd3ee8afe8c78347783ce5fa829cb78f1e5719e2
Signed-off-by: Joel Kitching <kitching@google.com>
Cq-Depend: chromium:1728113, chromium:1728499
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1728292
Reviewed-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
diff --git a/tests/vboot_api_kernel2_tests.c b/tests/vboot_api_kernel2_tests.c
index f37913c..56e8727 100644
--- a/tests/vboot_api_kernel2_tests.c
+++ b/tests/vboot_api_kernel2_tests.c
@@ -180,7 +180,7 @@
 	return result;
 }
 
-int VbExLegacy(enum VbAltFwIndex_t _altfw_num)
+vb2_error_t VbExLegacy(enum VbAltFwIndex_t _altfw_num)
 {
 	vbexlegacy_called++;
 	altfw_num = _altfw_num;
@@ -234,7 +234,7 @@
 	return 1;
 }
 
-uint32_t VbTryLoadKernel(struct vb2_context *c, uint32_t get_info_flags)
+vb2_error_t VbTryLoadKernel(struct vb2_context *c, uint32_t get_info_flags)
 {
 	return vbtlk_retval + get_info_flags;
 }
@@ -248,7 +248,7 @@
 	return VBERROR_SUCCESS;
 }
 
-uint32_t SetVirtualDevMode(int val)
+vb2_error_t SetVirtualDevMode(int val)
 {
 	virtdev_set = val;
 	return virtdev_retval;
@@ -262,7 +262,7 @@
 	return VBERROR_SUCCESS;
 }
 
-int vb2ex_tpm_set_mode(enum vb2_tpm_mode mode_val)
+vb2_error_t vb2ex_tpm_set_mode(enum vb2_tpm_mode mode_val)
 {
 	tpm_set_mode_called = 1;
 	/*