Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352857
b: refs/heads/master
c: 775585e
h: refs/heads/master
i:
  352855: 845cd24
v: v3
  • Loading branch information
Kent Yoder committed Feb 5, 2013
1 parent 1a8c040 commit 33010c4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 251a7b08213af82e40e4a70cac056e245853c410
refs/heads/master: 775585e47cd6b5eddf814d53b117b56a1a171553
4 changes: 3 additions & 1 deletion trunk/drivers/char/tpm/tpm.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,14 @@ struct tpm_vendor_specific {
bool timeout_adjusted;
unsigned long duration[3]; /* jiffies */
bool duration_adjusted;
void *data;
void *priv;

wait_queue_head_t read_queue;
wait_queue_head_t int_queue;
};

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

#define TPM_VID_INTEL 0x8086

struct tpm_chip {
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/char/tpm/tpm_ibmvtpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static struct ibmvtpm_dev *ibmvtpm_get_data(const struct device *dev)
{
struct tpm_chip *chip = dev_get_drvdata(dev);
if (chip)
return (struct ibmvtpm_dev *)chip->vendor.data;
return (struct ibmvtpm_dev *)TPM_VPRIV(chip);
return NULL;
}

Expand All @@ -83,7 +83,7 @@ static int tpm_ibmvtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count)
u16 len;
int sig;

ibmvtpm = (struct ibmvtpm_dev *)chip->vendor.data;
ibmvtpm = (struct ibmvtpm_dev *)TPM_VPRIV(chip);

if (!ibmvtpm->rtce_buf) {
dev_err(ibmvtpm->dev, "ibmvtpm device is not ready\n");
Expand Down Expand Up @@ -127,7 +127,7 @@ static int tpm_ibmvtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)
u64 *word = (u64 *) &crq;
int rc;

ibmvtpm = (struct ibmvtpm_dev *)chip->vendor.data;
ibmvtpm = (struct ibmvtpm_dev *)TPM_VPRIV(chip);

if (!ibmvtpm->rtce_buf) {
dev_err(ibmvtpm->dev, "ibmvtpm device is not ready\n");
Expand Down Expand Up @@ -647,7 +647,7 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,

ibmvtpm->dev = dev;
ibmvtpm->vdev = vio_dev;
chip->vendor.data = (void *)ibmvtpm;
TPM_VPRIV(chip) = (void *)ibmvtpm;

spin_lock_init(&ibmvtpm->rtce_lock);

Expand Down

0 comments on commit 33010c4

Please sign in to comment.