mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 05:29:04 -04:00
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>
This commit is contained in:
parent
e5b57c037a
commit
f21ec3d2d4
13 changed files with 20 additions and 14 deletions
|
|
@ -514,6 +514,12 @@ static inline struct tty_port *tty_port_get(struct tty_port *port)
|
|||
return port;
|
||||
}
|
||||
|
||||
/* If the cts flow control is enabled, return true. */
|
||||
static inline bool tty_port_cts_enabled(struct tty_port *port)
|
||||
{
|
||||
return port->flags & ASYNC_CTS_FLOW;
|
||||
}
|
||||
|
||||
extern struct tty_struct *tty_port_tty_get(struct tty_port *port);
|
||||
extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty);
|
||||
extern int tty_port_carrier_raised(struct tty_port *port);
|
||||
|
|
|
|||
Loading…
Reference in a new issue