diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2016-03-31 23:56:58 +0300 |
---|---|---|
committer | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | 2016-06-25 17:26:35 +0300 |
commit | 56671c893e0e3ee237bc8e229923a9e6555c2fc9 (patch) | |
tree | 4691182cc215bbeec44b98e51641627149e9c373 /drivers/char/tpm/st33zp24 | |
parent | 6e599f6f261fe61582e6bedcc0aff924ac5da614 (diff) | |
download | linux-56671c893e0e3ee237bc8e229923a9e6555c2fc9.tar.xz |
tpm: drop 'locality' from struct tpm_vendor_specific
Dropped the field 'locality' from struct tpm_vendor_specific migrated it to
the private structures of st33zp24, tpm_i2c_infineon and tpm_tis.
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.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/st33zp24')
-rw-r--r-- | drivers/char/tpm/st33zp24/st33zp24.c | 12 | ||||
-rw-r--r-- | drivers/char/tpm/st33zp24/st33zp24.h | 1 |
2 files changed, 7 insertions, 6 deletions
diff --git a/drivers/char/tpm/st33zp24/st33zp24.c b/drivers/char/tpm/st33zp24/st33zp24.c index d2e01754e1db..3802c5887090 100644 --- a/drivers/char/tpm/st33zp24/st33zp24.c +++ b/drivers/char/tpm/st33zp24/st33zp24.c @@ -136,7 +136,7 @@ static int check_locality(struct tpm_chip *chip) if (status && (data & (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) == (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) - return chip->vendor.locality; + return tpm_dev->locality; return -EACCES; } /* check_locality() */ @@ -153,11 +153,11 @@ static int request_locality(struct tpm_chip *chip) struct st33zp24_dev *tpm_dev; u8 data; - if (check_locality(chip) == chip->vendor.locality) - return chip->vendor.locality; - tpm_dev = (struct st33zp24_dev *)TPM_VPRIV(chip); + if (check_locality(chip) == tpm_dev->locality) + return tpm_dev->locality; + data = TPM_ACCESS_REQUEST_USE; ret = tpm_dev->ops->send(tpm_dev->phy_id, TPM_ACCESS, &data, 1); if (ret < 0) @@ -168,7 +168,7 @@ static int request_locality(struct tpm_chip *chip) /* Request locality is usually effective after the request */ do { if (check_locality(chip) >= 0) - return chip->vendor.locality; + return tpm_dev->locality; msleep(TPM_TIMEOUT); } while (time_before(jiffies, stop)); @@ -566,7 +566,7 @@ int st33zp24_probe(void *phy_id, const struct st33zp24_phy_ops *ops, chip->vendor.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT); chip->vendor.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT); - chip->vendor.locality = LOCALITY0; + tpm_dev->locality = LOCALITY0; if (irq) { /* INTERRUPT Setup */ diff --git a/drivers/char/tpm/st33zp24/st33zp24.h b/drivers/char/tpm/st33zp24/st33zp24.h index 9b5cdc71b6a7..6f4a4198af6a 100644 --- a/drivers/char/tpm/st33zp24/st33zp24.h +++ b/drivers/char/tpm/st33zp24/st33zp24.h @@ -25,6 +25,7 @@ struct st33zp24_dev { struct tpm_chip *chip; void *phy_id; const struct st33zp24_phy_ops *ops; + int locality; int irq; u32 intrs; int io_lpcpd; |