diff options
author | Kent Yoder <key@linux.vnet.ibm.com> | 2012-12-05 12:36:20 -0500 |
---|---|---|
committer | Kent Yoder <key@linux.vnet.ibm.com> | 2013-02-05 10:38:23 -0500 |
commit | 775585e47cd6b5eddf814d53b117b56a1a171553 (patch) | |
tree | 5b874d4d54ebfef37714ac0687662c6c4177fbe1 | |
parent | 251a7b08213af82e40e4a70cac056e245853c410 (diff) |
tpm: rename vendor data to priv and provide an accessor
"data" was too generic a name for what's being used as a generic
private pointer by vendor-specific code. Rename it to "priv" and provide
a #define for users.
Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
-rw-r--r-- | drivers/char/tpm/tpm.h | 4 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_ibmvtpm.c | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index 04b4547162c8..cbee6319be75 100644 --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h | |||
@@ -101,12 +101,14 @@ struct tpm_vendor_specific { | |||
101 | bool timeout_adjusted; | 101 | bool timeout_adjusted; |
102 | unsigned long duration[3]; /* jiffies */ | 102 | unsigned long duration[3]; /* jiffies */ |
103 | bool duration_adjusted; | 103 | bool duration_adjusted; |
104 | void *data; | 104 | void *priv; |
105 | 105 | ||
106 | wait_queue_head_t read_queue; | 106 | wait_queue_head_t read_queue; |
107 | wait_queue_head_t int_queue; | 107 | wait_queue_head_t int_queue; |
108 | }; | 108 | }; |
109 | 109 | ||
110 | #define TPM_VPRIV(c) (c)->vendor.priv | ||
111 | |||
110 | #define TPM_VID_INTEL 0x8086 | 112 | #define TPM_VID_INTEL 0x8086 |
111 | 113 | ||
112 | struct tpm_chip { | 114 | struct tpm_chip { |
diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c index 9978609d93b2..6cd99bc1c5d4 100644 --- a/drivers/char/tpm/tpm_ibmvtpm.c +++ b/drivers/char/tpm/tpm_ibmvtpm.c | |||
@@ -64,7 +64,7 @@ static struct ibmvtpm_dev *ibmvtpm_get_data(const struct device *dev) | |||
64 | { | 64 | { |
65 | struct tpm_chip *chip = dev_get_drvdata(dev); | 65 | struct tpm_chip *chip = dev_get_drvdata(dev); |
66 | if (chip) | 66 | if (chip) |
67 | return (struct ibmvtpm_dev *)chip->vendor.data; | 67 | return (struct ibmvtpm_dev *)TPM_VPRIV(chip); |
68 | return NULL; | 68 | return NULL; |
69 | } | 69 | } |
70 | 70 | ||
@@ -83,7 +83,7 @@ static int tpm_ibmvtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count) | |||
83 | u16 len; | 83 | u16 len; |
84 | int sig; | 84 | int sig; |
85 | 85 | ||
86 | ibmvtpm = (struct ibmvtpm_dev *)chip->vendor.data; | 86 | ibmvtpm = (struct ibmvtpm_dev *)TPM_VPRIV(chip); |
87 | 87 | ||
88 | if (!ibmvtpm->rtce_buf) { | 88 | if (!ibmvtpm->rtce_buf) { |
89 | dev_err(ibmvtpm->dev, "ibmvtpm device is not ready\n"); | 89 | dev_err(ibmvtpm->dev, "ibmvtpm device is not ready\n"); |
@@ -127,7 +127,7 @@ static int tpm_ibmvtpm_send(struct tpm_chip *chip, u8 *buf, size_t count) | |||
127 | u64 *word = (u64 *) &crq; | 127 | u64 *word = (u64 *) &crq; |
128 | int rc; | 128 | int rc; |
129 | 129 | ||
130 | ibmvtpm = (struct ibmvtpm_dev *)chip->vendor.data; | 130 | ibmvtpm = (struct ibmvtpm_dev *)TPM_VPRIV(chip); |
131 | 131 | ||
132 | if (!ibmvtpm->rtce_buf) { | 132 | if (!ibmvtpm->rtce_buf) { |
133 | dev_err(ibmvtpm->dev, "ibmvtpm device is not ready\n"); | 133 | dev_err(ibmvtpm->dev, "ibmvtpm device is not ready\n"); |
@@ -647,7 +647,7 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev, | |||
647 | 647 | ||
648 | ibmvtpm->dev = dev; | 648 | ibmvtpm->dev = dev; |
649 | ibmvtpm->vdev = vio_dev; | 649 | ibmvtpm->vdev = vio_dev; |
650 | chip->vendor.data = (void *)ibmvtpm; | 650 | TPM_VPRIV(chip) = (void *)ibmvtpm; |
651 | 651 | ||
652 | spin_lock_init(&ibmvtpm->rtce_lock); | 652 | spin_lock_init(&ibmvtpm->rtce_lock); |
653 | 653 | ||