aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2007-09-05 15:29:10 -0400
committerKumar Gala <galak@kernel.crashing.org>2007-09-10 17:02:09 -0400
commit83fcdb4b352f74a8a74737aedeaf622c37140c73 (patch)
tree2f948f23d9bf48aa08f82ff48661440c969ffa1c /arch
parent36c50f729b77144cae8d43457fefca66a4eeff6a (diff)
[POWERPC] cpm2: Fix off-by-one error in setbrg().
The hardware adds one to the BRG value to get the divider, so it must be subtracted by software. Without this patch, characters will occasionally be corrupted. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/sysdev/cpm2_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c
index 924412974795..c827715a5090 100644
--- a/arch/powerpc/sysdev/cpm2_common.c
+++ b/arch/powerpc/sysdev/cpm2_common.c
@@ -102,7 +102,7 @@ cpm_setbrg(uint brg, uint rate)
102 brg -= 4; 102 brg -= 4;
103 } 103 }
104 bp += brg; 104 bp += brg;
105 *bp = ((BRG_UART_CLK / rate) << 1) | CPM_BRG_EN; 105 out_be32(bp, (((BRG_UART_CLK / rate) - 1) << 1) | CPM_BRG_EN);
106 106
107 cpm2_unmap(bp); 107 cpm2_unmap(bp);
108} 108}