mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] tpm_tis: drop manufacturer_id from struct tpm_vendor_specific
@ 2016-03-23  5:31 Jarkko Sakkinen
  2016-03-23 16:43 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Jarkko Sakkinen @ 2016-03-23  5:31 UTC (permalink / raw)
  To: Peter Huewe
  Cc: Jarkko Sakkinen, Marcel Selhorst, Jason Gunthorpe,
	moderated list:TPM DEVICE DRIVER, open list

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>
---
 drivers/char/tpm/tpm.h     | 2 --
 drivers/char/tpm/tpm_tis.c | 7 +++++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index cbab4e9..fcd7f1e 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 7d7a776..068f021 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)));
@@ -722,7 +725,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",
-- 
2.7.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] tpm_tis: drop manufacturer_id from struct tpm_vendor_specific
  2016-03-23  5:31 [PATCH] tpm_tis: drop manufacturer_id from struct tpm_vendor_specific Jarkko Sakkinen
@ 2016-03-23 16:43 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2016-03-23 16:43 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: Peter Huewe, Marcel Selhorst, moderated list:TPM DEVICE DRIVER,
	open list

On Wed, Mar 23, 2016 at 07:31:56AM +0200, Jarkko Sakkinen wrote:
> 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.

Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-23 16:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-23  5:31 [PATCH] tpm_tis: drop manufacturer_id from struct tpm_vendor_specific Jarkko Sakkinen
2016-03-23 16:43 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®