summaryrefslogtreecommitdiff
path: root/include/linux/serial_core.h
diff options
context:
space:
mode:
authorAnton Vorontsov <cbouatmailru@gmail.com>2010-10-01 17:21:25 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 10:20:07 -0700
commit54381067ed7873e6173d6fe32818a585ad667723 (patch)
tree188acc1fdb9741188cfa3be68b20c76607a70135 /include/linux/serial_core.h
parent8ee16a1b8985ac930d293553f589b5894eb6a60e (diff)
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 <cbouatmailru@gmail.com> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/serial_core.h')
-rw-r--r--include/linux/serial_core.h8
1 files changed, 8 insertions, 0 deletions
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.
*/