summaryrefslogtreecommitdiff
path: root/drivers/char/tpm/tpm_eventlog.c
diff options
context:
space:
mode:
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2016-11-14 13:00:51 +0300
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2016-11-28 02:31:32 +0300
commit7518a21a9da39dc605ae08714ad046bfeca26f9b (patch)
tree3ca263df64b869349e3de611966038891a871574 /drivers/char/tpm/tpm_eventlog.c
parentcd9b7631a888f6615dac148c10d72a253b98c64b (diff)
downloadlinux-7518a21a9da39dc605ae08714ad046bfeca26f9b.tar.xz
tpm: drop tpm1_chip_register(/unregister)
Check for TPM2 chip in tpm_sysfs_add_device, tpm_bios_log_setup and tpm_bios_log_teardown in order to make code flow cleaner and to enable to implement TPM 2.0 support later on. This is partially derived from the commit by Nayna Jain with the extension that also tpm1_chip_register is dropped. Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Reviewed-by: Nayna Jain <nayna@linux.vnet.ibm.com> Tested-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Tested-by: Nayna Jain <nayna@linux.vnet.ibm.com>
Diffstat (limited to 'drivers/char/tpm/tpm_eventlog.c')
-rw-r--r--drivers/char/tpm/tpm_eventlog.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/char/tpm/tpm_eventlog.c b/drivers/char/tpm/tpm_eventlog.c
index 9c6447642144..0afb0f4e81f0 100644
--- a/drivers/char/tpm/tpm_eventlog.c
+++ b/drivers/char/tpm/tpm_eventlog.c
@@ -364,6 +364,9 @@ int tpm_bios_log_setup(struct tpm_chip *chip)
const char *name = dev_name(&chip->dev);
unsigned int cnt;
+ if (chip->flags & TPM_CHIP_FLAG_TPM2)
+ return 0;
+
cnt = 0;
chip->bios_dir[cnt] = securityfs_create_dir(name, NULL);
/* NOTE: securityfs_create_dir can return ENODEV if securityfs is