diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/tpm/tpm_i2c_infineon.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/char/tpm/tpm_i2c_infineon.c b/drivers/char/tpm/tpm_i2c_infineon.c index d83bb8c0217b..37d5dcc10ea7 100644 --- a/drivers/char/tpm/tpm_i2c_infineon.c +++ b/drivers/char/tpm/tpm_i2c_infineon.c | |||
@@ -162,6 +162,10 @@ out: | |||
162 | /* take care of 'guard time' */ | 162 | /* take care of 'guard time' */ |
163 | usleep_range(SLEEP_DURATION_LOW, SLEEP_DURATION_HI); | 163 | usleep_range(SLEEP_DURATION_LOW, SLEEP_DURATION_HI); |
164 | 164 | ||
165 | /* __i2c_transfer returns the number of successfully transferred | ||
166 | * messages. | ||
167 | * So rc should be greater than 0 here otherwise we have an error. | ||
168 | */ | ||
165 | if (rc <= 0) | 169 | if (rc <= 0) |
166 | return -EIO; | 170 | return -EIO; |
167 | 171 | ||
@@ -208,6 +212,11 @@ static int iic_tpm_write_generic(u8 addr, u8 *buffer, size_t len, | |||
208 | i2c_unlock_adapter(tpm_dev.client->adapter); | 212 | i2c_unlock_adapter(tpm_dev.client->adapter); |
209 | /* take care of 'guard time' */ | 213 | /* take care of 'guard time' */ |
210 | usleep_range(SLEEP_DURATION_LOW, SLEEP_DURATION_HI); | 214 | usleep_range(SLEEP_DURATION_LOW, SLEEP_DURATION_HI); |
215 | |||
216 | /* __i2c_transfer returns the number of successfully transferred | ||
217 | * messages. | ||
218 | * So rc should be greater than 0 here otherwise we have an error. | ||
219 | */ | ||
211 | if (rc <= 0) | 220 | if (rc <= 0) |
212 | return -EIO; | 221 | return -EIO; |
213 | 222 | ||