From c966075f46d8f54c3a799cd74bc4f3ec46fe553a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= Date: Tue, 19 Sep 2017 15:19:54 +0200 Subject: Use stopwatch_wait_until_expired where applicable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4d6c6810b91294a7e401a4a1a446218c04c98e55 Signed-off-by: Jonathan Neuschäfer Reviewed-on: https://review.coreboot.org/21590 Tested-by: build bot (Jenkins) Reviewed-by: Mario Scheithauer --- src/ec/google/chromeec/ec_spi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ec') diff --git a/src/ec/google/chromeec/ec_spi.c b/src/ec/google/chromeec/ec_spi.c index 810979ed49..3611814b66 100644 --- a/src/ec/google/chromeec/ec_spi.c +++ b/src/ec/google/chromeec/ec_spi.c @@ -51,8 +51,9 @@ static int crosec_spi_io(size_t req_size, size_t resp_size, void *context) struct spi_slave *slave = (struct spi_slave *)context; int ret = 0; - while (!stopwatch_expired(&cs_cooldown_sw)) - /* Wait minimum delay between CS assertions. */; + /* Wait minimum delay between CS assertions. */ + stopwatch_wait_until_expired(&cs_cooldown_sw); + spi_claim_bus(slave); /* Allow EC to ramp up clock after being awaken. -- cgit v1.2.3