aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/i2c/tpm/tis.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/i2c/tpm/tis.c')
-rw-r--r--src/drivers/i2c/tpm/tis.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/drivers/i2c/tpm/tis.c b/src/drivers/i2c/tpm/tis.c
index 3a5f519ee0..e8d69acfbf 100644
--- a/src/drivers/i2c/tpm/tis.c
+++ b/src/drivers/i2c/tpm/tis.c
@@ -79,10 +79,10 @@ int tis_init(void)
* Probe TPM twice; the first probing might fail because TPM is asleep,
* and the probing can wake up TPM.
*/
- uint8_t tmp;
+ uint8_t tmp = 0;
- if (i2c_read(bus, chip, 0, 0, &tmp, sizeof(tmp)) &&
- i2c_read(bus, chip, 0, 0, &tmp, sizeof(tmp)))
+ if (i2c_write(bus, chip, 0, 1, &tmp, sizeof(tmp)) &&
+ i2c_write(bus, chip, 0, 1, &tmp, sizeof(tmp)))
return -1;
return 0;