[PATCH 3/4 v4] tpm: sandbox: Change the return code when device is already open

Ilias Apalodimas ilias.apalodimas at linaro.org
Sat Feb 18 16:27:40 CET 2023


All the TPM drivers as well as out TCG TIS API for a TPM2.0 device
return -EBUSY if the device has already been opened.  Adjust
the sandbox TPM do return the same error code.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
---
Changes since v3:
- New patch. Required for [4/4]

 drivers/tpm/tpm2_tis_sandbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tpm/tpm2_tis_sandbox.c b/drivers/tpm/tpm2_tis_sandbox.c
index dd94bdc31fb7..e4004cfcca33 100644
--- a/drivers/tpm/tpm2_tis_sandbox.c
+++ b/drivers/tpm/tpm2_tis_sandbox.c
@@ -810,7 +810,7 @@ static int sandbox_tpm2_open(struct udevice *dev)
 	struct sandbox_tpm2 *tpm = dev_get_priv(dev);

 	if (tpm->init_done)
-		return -EIO;
+		return -EBUSY;

 	tpm->init_done = true;

--
2.39.2



More information about the U-Boot mailing list