summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-07-04 19:25:07 -0400
committerMike Frysinger <vapier@gentoo.org>2011-07-12 02:17:46 -0400
commitd8940a654435dfa48013229edf53bd3e353e97c1 (patch)
tree831154035451fd47c1895e4d48b24879534f7b2f
parentbb83875d5d11a314da276b31df430ee907a4ee3e (diff)
Blackfin: jtag-console: fix timer usage
Reported-by: Graeme Russ <graeme.russ@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--arch/blackfin/cpu/jtag-console.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/blackfin/cpu/jtag-console.c b/arch/blackfin/cpu/jtag-console.c
index e0f2975603..a77358a88a 100644
--- a/arch/blackfin/cpu/jtag-console.c
+++ b/arch/blackfin/cpu/jtag-console.c
@@ -48,11 +48,11 @@ static inline uint32_t bfin_read_emudat(void)
static bool jtag_write_emudat(uint32_t emudat)
{
static bool overflowed = false;
- ulong timeout = get_timer(0) + CONFIG_JTAG_CONSOLE_TIMEOUT;
+ ulong timeout = get_timer(0);
while (bfin_read_DBGSTAT() & 0x1) {
if (overflowed)
return overflowed;
- if (timeout < get_timer(0))
+ if (get_timer(timeout) > CONFIG_JTAG_CONSOLE_TIMEOUT)
overflowed = true;
}
overflowed = false;