Commit 9efa54f0 authored by Rajiv Andrade's avatar Rajiv Andrade

TPM: Use vendor specific function for status probe

Moved from using tpm_tis_status() to the vendor specific
one in wait_for_stat(). This way other TPM drivers can use it
instead of reimplementing another.
Signed-off-by: default avatarRajiv Andrade <srajiv@linux.vnet.ibm.com>
parent a927b813
...@@ -201,7 +201,7 @@ static int wait_for_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout, ...@@ -201,7 +201,7 @@ static int wait_for_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
u8 status; u8 status;
/* check current status */ /* check current status */
status = tpm_tis_status(chip); status = chip->vendor.status(chip);
if ((status & mask) == mask) if ((status & mask) == mask)
return 0; return 0;
...@@ -213,9 +213,9 @@ static int wait_for_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout, ...@@ -213,9 +213,9 @@ static int wait_for_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
if ((long)timeout <= 0) if ((long)timeout <= 0)
return -ETIME; return -ETIME;
rc = wait_event_interruptible_timeout(*queue, rc = wait_event_interruptible_timeout(*queue,
((tpm_tis_status ((chip->vendor.status(chip)
(chip) & mask) == & mask) == mask),
mask), timeout); timeout);
if (rc > 0) if (rc > 0)
return 0; return 0;
if (rc == -ERESTARTSYS && freezing(current)) { if (rc == -ERESTARTSYS && freezing(current)) {
...@@ -225,7 +225,7 @@ static int wait_for_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout, ...@@ -225,7 +225,7 @@ static int wait_for_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
} else { } else {
do { do {
msleep(TPM_TIMEOUT); msleep(TPM_TIMEOUT);
status = tpm_tis_status(chip); status = chip->vendor.status(chip);
if ((status & mask) == mask) if ((status & mask) == mask)
return 0; return 0;
} while (time_before(jiffies, stop)); } while (time_before(jiffies, stop));
......
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