summaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm-interface.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>2016-11-21 11:31:09 -0700
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2017-01-23 18:28:18 +0200
commit62bfdacbac4c5868862effbde8067c7582407190 (patch)
treeb679eb9ec49a2ef8cb9591263b734f60c9ea5fb3 /drivers/char/tpm/tpm-interface.c
parent19b7bf51fc3dcd8b743da72cfb69578de6eb9877 (diff)
downloadop-kernel-dev-62bfdacbac4c5868862effbde8067c7582407190.zip
op-kernel-dev-62bfdacbac4c5868862effbde8067c7582407190.tar.gz
tpm: Do not print an error message when doing TPM auto startup
This is a regression when this code was reworked and made the error print unconditional. The original code deliberately suppressed printing of the first error message so it could quietly sense TPM_ERR_INVALID_POSTINIT. Fixes: a502feb67b47 ("tpm: Clean up reading of timeout and duration capabilities") Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Diffstat (limited to 'drivers/char/tpm/tpm-interface.c')
-rw-r--r--drivers/char/tpm/tpm-interface.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
index 769d8b0..fecdd3f 100644
--- a/drivers/char/tpm/tpm-interface.c
+++ b/drivers/char/tpm/tpm-interface.c
@@ -546,8 +546,7 @@ int tpm_get_timeouts(struct tpm_chip *chip)
return 0;
}
- rc = tpm_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap,
- "attempting to determine the timeouts");
+ rc = tpm_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap, NULL);
if (rc == TPM_ERR_INVALID_POSTINIT) {
/* The TPM is not started, we are the first to talk to it.
Execute a startup command. */
@@ -558,8 +557,12 @@ int tpm_get_timeouts(struct tpm_chip *chip)
rc = tpm_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap,
"attempting to determine the timeouts");
}
- if (rc)
+ if (rc) {
+ dev_err(&chip->dev,
+ "A TPM error (%zd) occurred attempting to determine the timeouts\n",
+ rc);
return rc;
+ }
old_timeout[0] = be32_to_cpu(cap.timeout.a);
old_timeout[1] = be32_to_cpu(cap.timeout.b);
OpenPOWER on IntegriCloud