]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-at91/at91sam926x_time.c
[ARM] 4149/1: AT91: Overrun in SAM9 gettimeoffset().
[linux-2.6-omap-h63xx.git] / arch / arm / mach-at91 / at91sam926x_time.c
index 59cbbe1e81611246eb47aefffb9d91d5c637403a..a4dded27fa16a0dab13fa674293e7f2873b2a538 100644 (file)
@@ -30,7 +30,6 @@
  * Returns number of microseconds since last timer interrupt.  Note that interrupts
  * will have been disabled by do_gettimeofday()
  *  'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.
- *  'tick' is usecs per jiffy (linux/timex.h).
  */
 static unsigned long at91sam926x_gettimeoffset(void)
 {
@@ -39,7 +38,7 @@ static unsigned long at91sam926x_gettimeoffset(void)
 
        elapsed = (PIT_PICNT(t) * LATCH) + PIT_CPIV(t);         /* hardware clock cycles */
 
-       return (unsigned long)(elapsed * 1000000) / LATCH;
+       return (unsigned long)(elapsed * jiffies_to_usecs(1)) / LATCH;
 }
 
 /*