mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-04-02 04:21:32 +00:00
tpm: tpm_tis_i2c: Drop unnecessary methods
The function methods in struct tpm_vendor_specific just call local functions. Change the code to use a direct call. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
4cd7b7834c
commit
b382e02124
2 changed files with 4 additions and 12 deletions
|
@ -810,10 +810,6 @@ out_err:
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct tpm_vendor_specific tpm_tis_i2c = {
|
static struct tpm_vendor_specific tpm_tis_i2c = {
|
||||||
.status = tpm_tis_i2c_status,
|
|
||||||
.recv = tpm_tis_i2c_recv,
|
|
||||||
.send = tpm_tis_i2c_send,
|
|
||||||
.cancel = tpm_tis_i2c_ready,
|
|
||||||
.req_complete_mask = TPM_STS_DATA_AVAIL | TPM_STS_VALID,
|
.req_complete_mask = TPM_STS_DATA_AVAIL | TPM_STS_VALID,
|
||||||
.req_complete_val = TPM_STS_DATA_AVAIL | TPM_STS_VALID,
|
.req_complete_val = TPM_STS_DATA_AVAIL | TPM_STS_VALID,
|
||||||
.req_canceled = TPM_STS_COMMAND_READY,
|
.req_canceled = TPM_STS_COMMAND_READY,
|
||||||
|
@ -940,7 +936,7 @@ static ssize_t tpm_transmit(const unsigned char *buf, size_t bufsiz)
|
||||||
}
|
}
|
||||||
|
|
||||||
debug("Calling send\n");
|
debug("Calling send\n");
|
||||||
rc = chip->vendor.send(chip, (u8 *)buf, count);
|
rc = tpm_tis_i2c_send(chip, (u8 *)buf, count);
|
||||||
debug(" ... done calling send\n");
|
debug(" ... done calling send\n");
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
error("tpm_transmit: tpm_send: error %d\n", rc);
|
error("tpm_transmit: tpm_send: error %d\n", rc);
|
||||||
|
@ -954,7 +950,7 @@ static ssize_t tpm_transmit(const unsigned char *buf, size_t bufsiz)
|
||||||
stop = tpm_calc_ordinal_duration(chip, ordinal);
|
stop = tpm_calc_ordinal_duration(chip, ordinal);
|
||||||
do {
|
do {
|
||||||
debug("waiting for status... %ld %ld\n", start, stop);
|
debug("waiting for status... %ld %ld\n", start, stop);
|
||||||
u8 status = chip->vendor.status(chip);
|
u8 status = tpm_tis_i2c_status(chip);
|
||||||
if ((status & chip->vendor.req_complete_mask) ==
|
if ((status & chip->vendor.req_complete_mask) ==
|
||||||
chip->vendor.req_complete_val) {
|
chip->vendor.req_complete_val) {
|
||||||
debug("...got it;\n");
|
debug("...got it;\n");
|
||||||
|
@ -969,14 +965,14 @@ static ssize_t tpm_transmit(const unsigned char *buf, size_t bufsiz)
|
||||||
udelay(TPM_TIMEOUT * 1000);
|
udelay(TPM_TIMEOUT * 1000);
|
||||||
} while (get_timer(start) < stop);
|
} while (get_timer(start) < stop);
|
||||||
|
|
||||||
chip->vendor.cancel(chip);
|
tpm_tis_i2c_ready(chip);
|
||||||
error("Operation Timed out\n");
|
error("Operation Timed out\n");
|
||||||
rc = -ETIME;
|
rc = -ETIME;
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
out_recv:
|
out_recv:
|
||||||
debug("out_recv: reading response...\n");
|
debug("out_recv: reading response...\n");
|
||||||
rc = chip->vendor.recv(chip, (u8 *)buf, TPM_BUFSIZE);
|
rc = tpm_tis_i2c_recv(chip, (u8 *)buf, TPM_BUFSIZE);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
error("tpm_transmit: tpm_recv: error %d\n", rc);
|
error("tpm_transmit: tpm_recv: error %d\n", rc);
|
||||||
|
|
||||||
|
|
|
@ -40,10 +40,6 @@ struct tpm_vendor_specific {
|
||||||
const u8 req_complete_val;
|
const u8 req_complete_val;
|
||||||
const u8 req_canceled;
|
const u8 req_canceled;
|
||||||
int irq;
|
int irq;
|
||||||
int (*recv) (struct tpm_chip *, u8 *, size_t);
|
|
||||||
int (*send) (struct tpm_chip *, u8 *, size_t);
|
|
||||||
void (*cancel) (struct tpm_chip *);
|
|
||||||
u8(*status) (struct tpm_chip *);
|
|
||||||
int locality;
|
int locality;
|
||||||
unsigned long timeout_a, timeout_b, timeout_c, timeout_d; /* msec */
|
unsigned long timeout_a, timeout_b, timeout_c, timeout_d; /* msec */
|
||||||
unsigned long duration[3]; /* msec */
|
unsigned long duration[3]; /* msec */
|
||||||
|
|
Loading…
Add table
Reference in a new issue