From: roger blofeld This patch modifies uart_get_divisor to select the nearest baud rate divider rather than the lowest. It minimizes baud rate errors. For example, if uartclk is 33000000 and baud is 115200 the ratio is about 17.9 The current code selects 17 (5% error) but should select 18 (0.5% error) Signed-off-by: Andrew Morton --- 25-akpm/drivers/serial/serial_core.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/serial/serial_core.c~serial-pick-nearest-baud-rate-divider drivers/serial/serial_core.c --- 25/drivers/serial/serial_core.c~serial-pick-nearest-baud-rate-divider 2004-09-30 22:36:46.310831288 -0700 +++ 25-akpm/drivers/serial/serial_core.c 2004-09-30 22:36:46.315830528 -0700 @@ -395,7 +395,7 @@ uart_get_divisor(struct uart_port *port, if (baud == 38400 && (port->flags & UPF_SPD_MASK) == UPF_SPD_CUST) quot = port->custom_divisor; else - quot = port->uartclk / (16 * baud); + quot = (port->uartclk + (8 * baud)) / (16 * baud); return quot; } _