diff options
Diffstat (limited to 'src/soc/samsung/exynos5420/i2c.c')
-rw-r--r-- | src/soc/samsung/exynos5420/i2c.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/soc/samsung/exynos5420/i2c.c b/src/soc/samsung/exynos5420/i2c.c index 49875d79ed..8c6c361140 100644 --- a/src/soc/samsung/exynos5420/i2c.c +++ b/src/soc/samsung/exynos5420/i2c.c @@ -415,16 +415,13 @@ static int hsi2c_check_transfer(struct hsi2c_regs *regs) */ static int hsi2c_wait_for_transfer(struct hsi2c_regs *i2c) { - struct mono_time current, end; + struct stopwatch sw; - timer_monotonic_get(¤t); - end = current; - mono_time_add_usecs(&end, Hsi2cTimeout * 1000); - while (mono_time_before(¤t, &end)) { + stopwatch_init_msecs_expire(&sw, Hsi2cTimeout); + while (!stopwatch_expired(&sw)) { int ret = hsi2c_check_transfer(i2c); if (ret) return ret; - timer_monotonic_get(¤t); } return 0; } |