Skip to content

Commit

Permalink
[POWERPC] cpm2: Fix off-by-one error in setbrg().
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Scott Wood authored and Kumar Gala committed Sep 10, 2007
1 parent 36c50f7 commit 83fcdb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/sysdev/cpm2_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ cpm_setbrg(uint brg, uint rate)
brg -= 4;
}
bp += brg;
*bp = ((BRG_UART_CLK / rate) << 1) | CPM_BRG_EN;
out_be32(bp, (((BRG_UART_CLK / rate) - 1) << 1) | CPM_BRG_EN);

cpm2_unmap(bp);
}
Expand Down

0 comments on commit 83fcdb4

Please sign in to comment.