aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tty.h
diff options
context:
space:
mode:
authorHuang Shijie <shijie8@gmail.com>2012-08-22 22:13:36 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-05 16:28:35 -0400
commitf21ec3d2d46e5f2ffc06f31fe2704fdcea7a58f3 (patch)
tree5d814cd687776374f960d3af2490187c3fbdf750 /include/linux/tty.h
parente5b57c037a656c694c7f3674f96352297a6ee7d8 (diff)
serial: add a new helper function
In most of the time, the driver needs to check if the cts flow control is enabled. But now, the driver checks the ASYNC_CTS_FLOW flag manually, which is not a grace way. So add a new wraper function to make the code tidy and clean. Signed-off-by: Huang Shijie <shijie8@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r--include/linux/tty.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index dbebd1e56bc1..9892121354cd 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -514,6 +514,12 @@ static inline struct tty_port *tty_port_get(struct tty_port *port)
514 return port; 514 return port;
515} 515}
516 516
517/* If the cts flow control is enabled, return true. */
518static inline bool tty_port_cts_enabled(struct tty_port *port)
519{
520 return port->flags & ASYNC_CTS_FLOW;
521}
522
517extern struct tty_struct *tty_port_tty_get(struct tty_port *port); 523extern struct tty_struct *tty_port_tty_get(struct tty_port *port);
518extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); 524extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty);
519extern int tty_port_carrier_raised(struct tty_port *port); 525extern int tty_port_carrier_raised(struct tty_port *port);