summaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-nomadik/timer.c
diff options
context:
space:
mode:
authorLinus Walleij2012-10-18 11:12:31 +0200
committerLinus Walleij2012-11-05 09:55:32 +0100
commit2136683172f49a32b3ed7469f6e5ce20c8f4278b (patch)
tree3bfa057454f38388acfedb9e2144e8e5f07da3f6 /arch/arm/plat-nomadik/timer.c
parentARM: plat-nomadik: pass IRQ to timer driver (diff)
downloadkernel-qcow2-linux-2136683172f49a32b3ed7469f6e5ce20c8f4278b.tar.gz
kernel-qcow2-linux-2136683172f49a32b3ed7469f6e5ce20c8f4278b.tar.xz
kernel-qcow2-linux-2136683172f49a32b3ed7469f6e5ce20c8f4278b.zip
ARM: plat-nomadik: use DIV_ROUND_CLOSEST()
Use DIV_ROUND_CLOSEST() to calculate the cycle counter for the periodic mode instead of relying on homebrew reimplementation. Cc: Alessandro Rubini <rubini@unipv.it> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/plat-nomadik/timer.c')
-rw-r--r--arch/arm/plat-nomadik/timer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c
index 0ae2b068ee0f..f9114306657b 100644
--- a/arch/arm/plat-nomadik/timer.c
+++ b/arch/arm/plat-nomadik/timer.c
@@ -201,7 +201,8 @@ void __init nmdk_timer_init(void __iomem *base, int irq)
clk_prescale = MTU_CRn_PRESCALE_1;
}
- nmdk_cycle = (rate + HZ/2) / HZ;
+ /* Cycles for periodic mode */
+ nmdk_cycle = DIV_ROUND_CLOSEST(rate, HZ);
/* Timer 0 is the free running clocksource */