diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2011-12-20 10:47:44 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2012-01-05 00:18:54 (GMT) |
commit | 97d24634daff8b83dae21cfde68553ff4997e558 (patch) | |
tree | 444098d3fcca65273df44c20a5cc2ef895fef57f /drivers/tty/serial | |
parent | 1e9deb118ed76b9df89d189f27a06522a03cf743 (diff) | |
download | linux-fsl-qoriq-97d24634daff8b83dae21cfde68553ff4997e558.tar.xz |
serial: use DIV_ROUND_CLOSEST instead of open coding it
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r-- | drivers/tty/serial/serial_core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index d2990f7..c7bf31a 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -421,7 +421,7 @@ uart_get_divisor(struct uart_port *port, unsigned int baud) if (baud == 38400 && (port->flags & UPF_SPD_MASK) == UPF_SPD_CUST) quot = port->custom_divisor; else - quot = (port->uartclk + (8 * baud)) / (16 * baud); + quot = DIV_ROUND_CLOSEST(port->uartclk, 16 * baud); return quot; } |