diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-10-18 05:12:31 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-11-05 03:55:32 -0500 |
commit | 2136683172f49a32b3ed7469f6e5ce20c8f4278b (patch) | |
tree | 3bfa057454f38388acfedb9e2144e8e5f07da3f6 /arch/arm/plat-nomadik/timer.c | |
parent | 0813069d03f312b48b836f20e7f12073288f0f82 (diff) |
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.c | 3 |
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) | |||
201 | clk_prescale = MTU_CRn_PRESCALE_1; | 201 | clk_prescale = MTU_CRn_PRESCALE_1; |
202 | } | 202 | } |
203 | 203 | ||
204 | nmdk_cycle = (rate + HZ/2) / HZ; | 204 | /* Cycles for periodic mode */ |
205 | nmdk_cycle = DIV_ROUND_CLOSEST(rate, HZ); | ||
205 | 206 | ||
206 | 207 | ||
207 | /* Timer 0 is the free running clocksource */ | 208 | /* Timer 0 is the free running clocksource */ |