aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/sysdev/cpm2.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-02-11 13:37:44 +1100
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-02-11 13:37:44 +1100
commitedbc29d76ddbc9bd56e1cbc772188f70c616ffe1 (patch)
tree71b994ba493c46e10189c090fd17fe2da80281ec /arch/powerpc/sysdev/cpm2.c
parent1db8508cf483dc1ecf66141f90a7c03659d69512 (diff)
parenta0e8618c71b9b685977c1407dee928d86c5bdc2c (diff)
Merge commit 'kumar/next' into next
Diffstat (limited to 'arch/powerpc/sysdev/cpm2.c')
-rw-r--r--arch/powerpc/sysdev/cpm2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/sysdev/cpm2.c b/arch/powerpc/sysdev/cpm2.c
index f1c3395633b..474d176a6ec 100644
--- a/arch/powerpc/sysdev/cpm2.c
+++ b/arch/powerpc/sysdev/cpm2.c
@@ -129,7 +129,8 @@ void __cpm2_setbrg(uint brg, uint rate, uint clk, int div16, int src)
brg -= 4;
}
bp += brg;
- val = (((clk / rate) - 1) << 1) | CPM_BRG_EN | src;
+ /* Round the clock divider to the nearest integer. */
+ val = (((clk * 2 / rate) - 1) & ~1) | CPM_BRG_EN | src;
if (div16)
val |= CPM_BRG_DIV16;