Commit d4956524 authored by Jarkko Sakkinen's avatar Jarkko Sakkinen

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: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
parent 23d06ff7
...@@ -145,8 +145,6 @@ struct tpm_vendor_specific { ...@@ -145,8 +145,6 @@ struct tpm_vendor_specific {
void *priv; void *priv;
wait_queue_head_t read_queue; wait_queue_head_t read_queue;
u16 manufacturer_id;
}; };
#define TPM_VPRIV(c) ((c)->vendor.priv) #define TPM_VPRIV(c) ((c)->vendor.priv)
......
...@@ -94,6 +94,7 @@ struct tpm_info { ...@@ -94,6 +94,7 @@ struct tpm_info {
#define TPM_RID(l) (0x0F04 | ((l) << 12)) #define TPM_RID(l) (0x0F04 | ((l) << 12))
struct priv_data { struct priv_data {
u16 manufacturer_id;
bool irq_tested; bool irq_tested;
wait_queue_head_t int_queue; wait_queue_head_t int_queue;
}; };
...@@ -516,7 +517,9 @@ static int probe_itpm(struct tpm_chip *chip) ...@@ -516,7 +517,9 @@ static int probe_itpm(struct tpm_chip *chip)
static bool tpm_tis_req_canceled(struct tpm_chip *chip, u8 status) 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: case TPM_VID_WINBOND:
return ((status == TPM_STS_VALID) || return ((status == TPM_STS_VALID) ||
(status == (TPM_STS_VALID | TPM_STS_COMMAND_READY))); (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, ...@@ -717,7 +720,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
goto out_err; goto out_err;
vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0)); 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", dev_info(dev, "%s TPM (device-id 0x%X, rev-id %d)\n",
(chip->flags & TPM_CHIP_FLAG_TPM2) ? "2.0" : "1.2", (chip->flags & TPM_CHIP_FLAG_TPM2) ? "2.0" : "1.2",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment