summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRomain Izard <romain.izard.pro@gmail.com>2017-12-01 13:22:33 +0100
committerDaniel Lezcano <daniel.lezcano@linaro.org>2018-01-08 12:10:02 +0100
commit29a89971e205863efb44601e9bd0c13af7f1362b (patch)
tree8d8e32e754de414b8f1dc4c37e4c520cc8e637ea
parent6b20643405c87d835eef5e6d11d2034691f853b0 (diff)
clocksource/drivers/tcb_clksrc: Fix clock speed message
The clock speed displayed at boot in an information message was 500 kHz too high compared to its real value. As the value is not used anywhere, there is no functional impact. Fix the rounding formula to display the correct value. Signed-off-by: Romain Izard <romain.izard.pro@gmail.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-rw-r--r--drivers/clocksource/tcb_clksrc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c
index 9de47d4d2d9e..43f4d5c4d6fa 100644
--- a/drivers/clocksource/tcb_clksrc.c
+++ b/drivers/clocksource/tcb_clksrc.c
@@ -384,7 +384,7 @@ static int __init tcb_clksrc_init(void)
printk(bootinfo, clksrc.name, CONFIG_ATMEL_TCB_CLKSRC_BLOCK,
divided_rate / 1000000,
- ((divided_rate + 500000) % 1000000) / 1000);
+ ((divided_rate % 1000000) + 500) / 1000);
if (tc->tcb_config && tc->tcb_config->counter_width == 32) {
/* use apropriate function to read 32 bit counter */