]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ARM: highbank: fix us_to_tick calculation
authorRob Herring <rob.herring@calxeda.com>
Wed, 1 Feb 2012 16:57:52 +0000 (16:57 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Wed, 28 Mar 2012 21:31:08 +0000 (23:31 +0200)
udelay calls were off due to failing to convert us to ns. Fix this and drop
the unnecessary shifts since NS_PER_TICK is only 7ns.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
arch/arm/cpu/armv7/highbank/timer.c

index d92503f75126f81ac14fde2179e188133681d66c..0f985e298b591307668000045f3560a6c3b67604 100644 (file)
@@ -66,10 +66,10 @@ static inline unsigned long long time_to_tick(unsigned long long time)
 
 static inline unsigned long long us_to_tick(unsigned long long us)
 {
-       unsigned long long tick = us << 16;
+       unsigned long long tick = us * 1000;
        tick += NS_PER_TICK - 1;
        do_div(tick, NS_PER_TICK);
-       return tick >> 16;
+       return tick;
 }
 
 unsigned long long get_ticks(void)