From 54381067ed7873e6173d6fe32818a585ad667723 Mon Sep 17 00:00:00 2001 From: Anton Vorontsov Date: Fri, 1 Oct 2010 17:21:25 +0400 Subject: serial: Factor out uart_poll_timeout() from 8250 driver Soon we will use that handy function in the altera_uart driver. Signed-off-by: Anton Vorontsov Cc: Alan Cox Signed-off-by: Greg Kroah-Hartman --- include/linux/serial_core.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/linux/serial_core.h') diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 563e23400913..ac48082f3559 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -411,6 +411,14 @@ unsigned int uart_get_baud_rate(struct uart_port *port, struct ktermios *termios unsigned int max); unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud); +/* Base timer interval for polling */ +static inline int uart_poll_timeout(struct uart_port *port) +{ + int timeout = port->timeout; + + return timeout > 6 ? (timeout / 2 - 2) : 1; +} + /* * Console helpers. */ -- cgit v1.2.3