]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
tpm: sandbox: Change the return code when device is already open
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Sat, 18 Feb 2023 15:18:49 +0000 (17:18 +0200)
committerIlias Apalodimas <ilias.apalodimas@linaro.org>
Tue, 28 Feb 2023 07:44:25 +0000 (09:44 +0200)
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.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
drivers/tpm/tpm2_tis_sandbox.c

index dd94bdc31fb79252a5c72b496b7fc733ec5d66b9..e4004cfcca33278b92d6a9aaf998bb8df08a8e2c 100644 (file)
@@ -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;