summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/soc/rockchip/rk3288/spi.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/soc/rockchip/rk3288/spi.c b/src/soc/rockchip/rk3288/spi.c
index 396f537a01..844d692aa4 100644
--- a/src/soc/rockchip/rk3288/spi.c
+++ b/src/soc/rockchip/rk3288/spi.c
@@ -167,14 +167,13 @@ void spi_release_bus(struct spi_slave *slave)
static int rockchip_spi_wait_till_not_busy(struct rockchip_spi *regs)
{
- struct mono_time start;
- struct rela_time rt;
- timer_monotonic_get(&start);
+ struct stopwatch sw;
+
+ stopwatch_init_usecs_expire(&sw, SPI_TIMEOUT_US);
do {
if (!(readl(&regs->sr) & SR_BUSY))
return 0;
- rt = current_time_from(&start);
- } while (rela_time_in_microseconds(&rt) < SPI_TIMEOUT_US);
+ } while (!stopwatch_expired(&sw));
printk(BIOS_DEBUG,
"RK SPI: Status keeps busy for 1000us after a read/write!\n");
return -1;