diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2011-05-26 04:41:17 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-06-07 12:36:18 -0400 |
commit | 0e2adc06843a9b5a28af4ca5f796240297907897 (patch) | |
tree | 90e9cc20c82b8f13a602d381a1b0de0658df5148 /drivers/tty | |
parent | b9b24558f7d36c550b5cf0b550a8926f8c03cdbd (diff) |
serial/pch: use global div helper instead of creating a private one
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/pch_uart.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c index f2cb7503fcb..ae28250b0be 100644 --- a/drivers/tty/serial/pch_uart.c +++ b/drivers/tty/serial/pch_uart.c | |||
@@ -14,6 +14,7 @@ | |||
14 | *along with this program; if not, write to the Free Software | 14 | *along with this program; if not, write to the Free Software |
15 | *Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. | 15 | *Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. |
16 | */ | 16 | */ |
17 | #include <linux/kernel.h> | ||
17 | #include <linux/serial_reg.h> | 18 | #include <linux/serial_reg.h> |
18 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
19 | #include <linux/module.h> | 20 | #include <linux/module.h> |
@@ -137,8 +138,6 @@ enum { | |||
137 | #define PCH_UART_DLL 0x00 | 138 | #define PCH_UART_DLL 0x00 |
138 | #define PCH_UART_DLM 0x01 | 139 | #define PCH_UART_DLM 0x01 |
139 | 140 | ||
140 | #define DIV_ROUND(a, b) (((a) + ((b)/2)) / (b)) | ||
141 | |||
142 | #define PCH_UART_IID_RLS (PCH_UART_IIR_REI) | 141 | #define PCH_UART_IID_RLS (PCH_UART_IIR_REI) |
143 | #define PCH_UART_IID_RDR (PCH_UART_IIR_RRI) | 142 | #define PCH_UART_IID_RDR (PCH_UART_IIR_RRI) |
144 | #define PCH_UART_IID_RDR_TO (PCH_UART_IIR_RRI | PCH_UART_IIR_TOI) | 143 | #define PCH_UART_IID_RDR_TO (PCH_UART_IIR_RRI | PCH_UART_IIR_TOI) |
@@ -316,7 +315,7 @@ static int pch_uart_hal_set_line(struct eg20t_port *priv, int baud, | |||
316 | unsigned int dll, dlm, lcr; | 315 | unsigned int dll, dlm, lcr; |
317 | int div; | 316 | int div; |
318 | 317 | ||
319 | div = DIV_ROUND(priv->base_baud / 16, baud); | 318 | div = DIV_ROUND_CLOSEST(priv->base_baud / 16, baud); |
320 | if (div < 0 || USHRT_MAX <= div) { | 319 | if (div < 0 || USHRT_MAX <= div) { |
321 | dev_err(priv->port.dev, "Invalid Baud(div=0x%x)\n", div); | 320 | dev_err(priv->port.dev, "Invalid Baud(div=0x%x)\n", div); |
322 | return -EINVAL; | 321 | return -EINVAL; |