Signed-off-by: Andrey Smirnov <[email protected]>
---
 lib/clock.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/clock.c b/lib/clock.c
index b7cc49fa6..842aabc42 100644
--- a/lib/clock.c
+++ b/lib/clock.c
@@ -50,9 +50,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 emiiting a call to __aeabi_uldivmod here
+        */
+       udelay(msecs * (MSECOND / USECOND));
 }
 EXPORT_SYMBOL(mdelay);
 
-- 
2.17.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to