Skip to content

Commit ceea3a7

Browse files
author
Jarkko Sakkinen
committed
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>
1 parent 381e0ca commit ceea3a7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

drivers/char/tpm/tpm.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@ struct tpm_vendor_specific {
145145
void *priv;
146146

147147
wait_queue_head_t read_queue;
148-
149-
u16 manufacturer_id;
150148
};
151149

152150
#define TPM_VPRIV(c) ((c)->vendor.priv)

drivers/char/tpm/tpm_tis.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ struct tpm_info {
9494
#define TPM_RID(l) (0x0F04 | ((l) << 12))
9595

9696
struct priv_data {
97+
u16 manufacturer_id;
9798
bool irq_tested;
9899
wait_queue_head_t int_queue;
99100
};
@@ -516,7 +517,9 @@ static int probe_itpm(struct tpm_chip *chip)
516517

517518
static bool tpm_tis_req_canceled(struct tpm_chip *chip, u8 status)
518519
{
519-
switch (chip->vendor.manufacturer_id) {
520+
struct priv_data *priv = chip->vendor.priv;
521+
522+
switch (priv->manufacturer_id) {
520523
case TPM_VID_WINBOND:
521524
return ((status == TPM_STS_VALID) ||
522525
(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,
717720
goto out_err;
718721

719722
vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0));
720-
chip->vendor.manufacturer_id = vendor;
723+
priv->manufacturer_id = vendor;
721724

722725
dev_info(dev, "%s TPM (device-id 0x%X, rev-id %d)\n",
723726
(chip->flags & TPM_CHIP_FLAG_TPM2) ? "2.0" : "1.2",

0 commit comments

Comments
 (0)