summaryrefslogtreecommitdiff
path: root/drivers/clocksource
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2010-08-02 13:24:05 +0400
committerPaul Mundt <lethal@linux-sh.org>2010-08-04 11:01:29 +0400
commit38409d726bc6413d39f082f60bc803f52d8b5849 (patch)
tree5b598d835b6d89b871b529e496f96d24b7496f1f /drivers/clocksource
parent43809473b9d5fa9f82bf64ddeb3c21fe1140ef0e (diff)
downloadlinux-38409d726bc6413d39f082f60bc803f52d8b5849.tar.xz
clocksource: sh_cmt: Rate calculation fix
Fix the rate calculation in the CMT driver. Without this fix the clocksource runs way too fast and we get a divide-by-zero error. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/clocksource')
-rw-r--r--drivers/clocksource/sh_cmt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index ed8e07b97e27..a44611652282 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -445,7 +445,7 @@ static int sh_cmt_register_clocksource(struct sh_cmt_priv *p,
/* clk_get_rate() needs an enabled clock */
clk_enable(p->clk);
- p->rate = clk_get_rate(p->clk) / (p->width == 16) ? 512 : 8;
+ p->rate = clk_get_rate(p->clk) / ((p->width == 16) ? 512 : 8);
clk_disable(p->clk);
/* TODO: calculate good shift from rate and counter bit width */