diff options
author | Anton Vorontsov <cbouatmailru@gmail.com> | 2010-10-01 09:21:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-22 13:20:07 -0400 |
commit | 54381067ed7873e6173d6fe32818a585ad667723 (patch) | |
tree | 188acc1fdb9741188cfa3be68b20c76607a70135 /include/linux/serial_core.h | |
parent | 8ee16a1b8985ac930d293553f589b5894eb6a60e (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.h | 8 |
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 | |||
411 | unsigned int max); | 411 | unsigned int max); |
412 | unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud); | 412 | unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud); |
413 | 413 | ||
414 | /* Base timer interval for polling */ | ||
415 | static inline int uart_poll_timeout(struct uart_port *port) | ||
416 | { | ||
417 | int timeout = port->timeout; | ||
418 | |||
419 | return timeout > 6 ? (timeout / 2 - 2) : 1; | ||
420 | } | ||
421 | |||
414 | /* | 422 | /* |
415 | * Console helpers. | 423 | * Console helpers. |
416 | */ | 424 | */ |