[PATCH 03/10] tpm: Fix the return type of tpm_startup
Sughosh Ganu
sughosh.ganu at linaro.org
Thu Feb 24 19:05:45 CET 2022
The tpm_startup function returns negative values for error
conditions. Fix the return type of the function to a signed int
instead of a u32.
Signed-off-by: Sughosh Ganu <sughosh.ganu at linaro.org>
---
include/tpm_api.h | 2 +-
lib/tpm_api.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/tpm_api.h b/include/tpm_api.h
index b9e3e8b5e6..fb6ee14e23 100644
--- a/include/tpm_api.h
+++ b/include/tpm_api.h
@@ -18,7 +18,7 @@
* @param mode TPM startup mode
* Return: return code of the operation
*/
-u32 tpm_startup(struct udevice *dev, enum tpm_startup_type mode);
+int tpm_startup(struct udevice *dev, enum tpm_startup_type mode);
/**
* Issue a TPM_SelfTestFull command.
diff --git a/lib/tpm_api.c b/lib/tpm_api.c
index 1bbe33a3fc..b762202866 100644
--- a/lib/tpm_api.c
+++ b/lib/tpm_api.c
@@ -21,7 +21,7 @@ static bool is_tpm2(struct udevice *dev)
return IS_ENABLED(CONFIG_TPM_V2) && tpm_get_version(dev) == TPM_V2;
}
-u32 tpm_startup(struct udevice *dev, enum tpm_startup_type mode)
+int tpm_startup(struct udevice *dev, enum tpm_startup_type mode)
{
if (is_tpm1(dev)) {
return tpm1_startup(dev, mode);
--
2.17.1
More information about the U-Boot
mailing list