Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259317
b: refs/heads/master
c: 0e2adc0
h: refs/heads/master
i:
  259315: 73455f7
v: v3
  • Loading branch information
Uwe Kleine-König authored and Greg Kroah-Hartman committed Jun 7, 2011
1 parent 8c719d0 commit 9f30188
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b9b24558f7d36c550b5cf0b550a8926f8c03cdbd
refs/heads/master: 0e2adc06843a9b5a28af4ca5f796240297907897
5 changes: 2 additions & 3 deletions trunk/drivers/tty/serial/pch_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*along with this program; if not, write to the Free Software
*Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*/
#include <linux/kernel.h>
#include <linux/serial_reg.h>
#include <linux/slab.h>
#include <linux/module.h>
Expand Down Expand Up @@ -137,8 +138,6 @@ enum {
#define PCH_UART_DLL 0x00
#define PCH_UART_DLM 0x01

#define DIV_ROUND(a, b) (((a) + ((b)/2)) / (b))

#define PCH_UART_IID_RLS (PCH_UART_IIR_REI)
#define PCH_UART_IID_RDR (PCH_UART_IIR_RRI)
#define PCH_UART_IID_RDR_TO (PCH_UART_IIR_RRI | PCH_UART_IIR_TOI)
Expand Down Expand Up @@ -316,7 +315,7 @@ static int pch_uart_hal_set_line(struct eg20t_port *priv, int baud,
unsigned int dll, dlm, lcr;
int div;

div = DIV_ROUND(priv->base_baud / 16, baud);
div = DIV_ROUND_CLOSEST(priv->base_baud / 16, baud);
if (div < 0 || USHRT_MAX <= div) {
dev_err(priv->port.dev, "Invalid Baud(div=0x%x)\n", div);
return -EINVAL;
Expand Down

0 comments on commit 9f30188

Please sign in to comment.