Signed-off-by: Andrey Smirnov <andrew.smir...@gmail.com>
---
 common/clock.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/common/clock.c b/common/clock.c
index f98176dd5..dab6e979f 100644
--- a/common/clock.c
+++ b/common/clock.c
@@ -206,9 +206,11 @@ EXPORT_SYMBOL(udelay);
 
 void mdelay(unsigned long msecs)
 {
-       uint64_t start = get_time_ns();
-
-       while(!is_timeout(start, msecs * MSECOND));
+       /*
+        * Parens around division below are needed to pervent ARM/EABI
+        * toolchain from emitting a call to __aeabi_uldivmod.
+        */
+       udelay(msecs * (MSECOND / USECOND));
 }
 EXPORT_SYMBOL(mdelay);
 
-- 
2.17.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to