summaryrefslogtreecommitdiff
path: root/drivers/char/tpm/tpm-chip.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2018-10-19 21:22:59 +0300
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2018-11-13 13:46:31 +0200
commitb03c43702e7be68dab9d443afbdc934ee4096b03 (patch)
tree7c633db60e138a2f3ab391228951793e1d11c2f6 /drivers/char/tpm/tpm-chip.c
parent9db7fe187c54f216fc58deb062fe8bd5dc0e27d8 (diff)
tpm: add tpm_auto_startup() into tpm-interface.c
Add wrapper tpm_auto_startup() to tpm-interface.c instead of open coded decision between TPM 1.x and TPM 2.x in tpm-chip.c Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.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-chip.c')
-rw-r--r--drivers/char/tpm/tpm-chip.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c
index 46caadca916a..32db84683c40 100644
--- a/drivers/char/tpm/tpm-chip.c
+++ b/drivers/char/tpm/tpm-chip.c
@@ -451,14 +451,9 @@ int tpm_chip_register(struct tpm_chip *chip)
{
int rc;
- if (chip->ops->flags & TPM_OPS_AUTO_STARTUP) {
- if (chip->flags & TPM_CHIP_FLAG_TPM2)
- rc = tpm2_auto_startup(chip);
- else
- rc = tpm1_auto_startup(chip);
- if (rc)
- return rc;
- }
+ rc = tpm_auto_startup(chip);
+ if (rc)
+ return rc;
tpm_sysfs_add_device(chip);