summaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2016-03-23 07:31:56 +0200
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2016-06-25 17:26:35 +0300
commitd4956524f1b0ae010c6d6cc1369a7fae63b52165 (patch)
treeb334414999711d6ca3fe90553998d58335b3f079 /drivers/char
parent23d06ff700f546a6a1d63c85ade095dbd75b7ab5 (diff)
downloadlinux-d4956524f1b0ae010c6d6cc1369a7fae63b52165.tar.gz
linux-d4956524f1b0ae010c6d6cc1369a7fae63b52165.tar.bz2
linux-d4956524f1b0ae010c6d6cc1369a7fae63b52165.zip
tpm: drop manufacturer_id from struct tpm_vendor_specific
Dropped manufacturer_id from struct tpm_vendor_specific and redeclared it in the private struct priv_data that tpm_tis uses because the field is only used tpm_tis. Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/tpm/tpm.h2
-rw-r--r--drivers/char/tpm/tpm_tis.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index c5f8d9e4f953..6586b6aac23f 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -145,8 +145,6 @@ struct tpm_vendor_specific {
void *priv;
wait_queue_head_t read_queue;
-
- u16 manufacturer_id;
};
#define TPM_VPRIV(c) ((c)->vendor.priv)
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 9c3a52d1a702..bf9d3312104b 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -94,6 +94,7 @@ struct tpm_info {
#define TPM_RID(l) (0x0F04 | ((l) << 12))
struct priv_data {
+ u16 manufacturer_id;
bool irq_tested;
wait_queue_head_t int_queue;
};
@@ -516,7 +517,9 @@ out:
static bool tpm_tis_req_canceled(struct tpm_chip *chip, u8 status)
{
- switch (chip->vendor.manufacturer_id) {
+ struct priv_data *priv = chip->vendor.priv;
+
+ switch (priv->manufacturer_id) {
case TPM_VID_WINBOND:
return ((status == TPM_STS_VALID) ||
(status == (TPM_STS_VALID | TPM_STS_COMMAND_READY)));
@@ -717,7 +720,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
goto out_err;
vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0));
- chip->vendor.manufacturer_id = vendor;
+ priv->manufacturer_id = vendor;
dev_info(dev, "%s TPM (device-id 0x%X, rev-id %d)\n",
(chip->flags & TPM_CHIP_FLAG_TPM2) ? "2.0" : "1.2",