diff options
author | Nayna Jain <nayna@linux.vnet.ibm.com> | 2016-11-14 05:00:54 -0500 |
---|---|---|
committer | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | 2016-11-28 01:31:32 +0200 |
commit | 02ae1382882f08c5804b996ca9c8d79b399dbe36 (patch) | |
tree | 092dc7aa55337443505ab350a297e801edfc80e8 /drivers/char/tpm/tpm_of.c | |
parent | f40e68ef4a111d194a801abd1695f1ec8ef119ff (diff) | |
download | talos-obmc-linux-02ae1382882f08c5804b996ca9c8d79b399dbe36.tar.gz talos-obmc-linux-02ae1382882f08c5804b996ca9c8d79b399dbe36.zip |
tpm: redefine read_log() to handle ACPI/OF at runtime
Currently, read_log() has two implementations: one for ACPI platforms
and the other for device tree(OF) based platforms. The proper one is
selected at compile time using Kconfig and #ifdef in the Makefile,
which is not the recommended approach.
This patch removes the #ifdef in the Makefile by defining a single
read_log() method, which checks for ACPI/OF event log properties at
runtime.
[jarkko.sakkinen@linux.intel.com: added tpm_ prefix to read_log*]
Suggested-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Nayna Jain <nayna@linux.vnet.ibm.com>
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.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 | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/char/tpm/tpm_of.c b/drivers/char/tpm/tpm_of.c index 68d891ab55db..83c26bffb150 100644 --- a/drivers/char/tpm/tpm_of.c +++ b/drivers/char/tpm/tpm_of.c @@ -2,6 +2,7 @@ * Copyright 2012 IBM Corporation * * Author: Ashley Lai <ashleydlai@gmail.com> + * Nayna Jain <nayna@linux.vnet.ibm.com> * * Maintained by: <tpmdd-devel@lists.sourceforge.net> * @@ -20,7 +21,7 @@ #include "tpm.h" #include "tpm_eventlog.h" -int read_log(struct tpm_chip *chip) +int tpm_read_log_of(struct tpm_chip *chip) { struct device_node *np; const u32 *sizep; @@ -28,11 +29,6 @@ int read_log(struct tpm_chip *chip) 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; - } - np = of_find_node_by_name(NULL, "vtpm"); if (!np) { pr_err("%s: ERROR - IBMVTPM not supported\n", __func__); |