diff options
author | Nayna Jain <nayna@linux.vnet.ibm.com> | 2016-11-14 11:00:52 +0100 |
---|---|---|
committer | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | 2016-11-28 00:31:32 +0100 |
commit | 748935eeb72c34368ab514a2bfdf75161768cec0 (patch) | |
tree | 5e0b95019cee9c1bdc4501270ab74974e26a83d6 /drivers/char/tpm/tpm_of.c | |
parent | tpm: drop tpm1_chip_register(/unregister) (diff) | |
download | linux-748935eeb72c34368ab514a2bfdf75161768cec0.tar.xz linux-748935eeb72c34368ab514a2bfdf75161768cec0.zip |
tpm: have event log use the tpm_chip
Move the backing memory for the event log into tpm_chip and push
the tpm_chip into read_log. This optimizes read_log processing by
only doing it once and prepares things for the next patches in the
series which require the tpm_chip to locate the event log via
ACPI and OF handles instead of searching.
This is straightfoward except for the issue of passing a kref through
i_private with securityfs. Since securityfs_remove does not have any
removal fencing like sysfs we use the inode lock to safely get a
kref on the tpm_chip.
Suggested-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Nayna Jain <nayna@linux.vnet.ibm.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-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_of.c')
-rw-r--r-- | drivers/char/tpm/tpm_of.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm_of.c b/drivers/char/tpm/tpm_of.c index 570f30c5c5f4..68d891ab55db 100644 --- a/drivers/char/tpm/tpm_of.c +++ b/drivers/char/tpm/tpm_of.c @@ -20,12 +20,14 @@ #include "tpm.h" #include "tpm_eventlog.h" -int read_log(struct tpm_bios_log *log) +int read_log(struct tpm_chip *chip) { struct device_node *np; const u32 *sizep; const u64 *basep; + struct tpm_bios_log *log; + log = &chip->log; if (log->bios_event_log != NULL) { pr_err("%s: ERROR - Eventlog already initialized\n", __func__); return -EFAULT; |