tpm: spi: fix stopwatch implementation bug
authorVadim Bendebury <vbendeb@chromium.org>
Tue, 28 Jun 2016 01:05:31 +0000 (18:05 -0700)
committerchrome-bot <chrome-bot@chromium.org>
Tue, 28 Jun 2016 18:34:05 +0000 (11:34 -0700)
Stopwatch expiration check was expiring immediately, this patch fixes
the bug.

BRANCH=none
BUG=chrome-os-partner:50645
TEST=SPI TPM initialization does not fail any more.

Change-Id: I942ff694a237306eab60834c2cd5096775bfe8b8
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/356591
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
src/drivers/tpm/spi.c

index 55ea21f..acc2e99 100644 (file)
@@ -45,7 +45,7 @@ static void stopwatch_init_usecs_expire(struct stopwatch *sw, long us)
 
 static int stopwatch_expired(struct stopwatch *sw)
 {
-       return timer_us(sw->start > sw->expires);
+       return timer_us(sw->start) > sw->expires;
 }
 
 /*