]> git.sur5r.net Git - u-boot/blobdiff - board/integratorcp/integratorcp.c
Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
[u-boot] / board / integratorcp / integratorcp.c
index d6d6e13d5a475f20290bb86277affe17365522b8..220513f32947bfb492c2e8274b35d6d33242a52c 100644 (file)
@@ -34,6 +34,7 @@
  */
 
 #include <common.h>
+#include <div64.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -244,7 +245,11 @@ ulong get_timer_masked (void)
                total_count += lastdec - now;
        }
        lastdec   = now;
-       timestamp = (ulong)(total_count/div_timer);
+
+       /* Reuse "now" */
+       now = total_count;
+       do_div(now, div_timer);
+       timestamp = now;
 
        return timestamp;
 }