aboutsummaryrefslogtreecommitdiffstats
path: root/net
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 /net
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 'net')
-rw-r--r--net/irda/ircomm/ircomm_tty.c4
-rw-r--r--net/irda/ircomm/ircomm_tty_attach.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
index 96689906b93c..95a3a7a336ba 100644
--- a/net/irda/ircomm/ircomm_tty.c
+++ b/net/irda/ircomm/ircomm_tty.c
@@ -1070,7 +1070,7 @@ void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self)
1070 goto put; 1070 goto put;
1071 } 1071 }
1072 } 1072 }
1073 if (tty && self->port.flags & ASYNC_CTS_FLOW) { 1073 if (tty && tty_port_cts_enabled(&self->port)) {
1074 if (tty->hw_stopped) { 1074 if (tty->hw_stopped) {
1075 if (status & IRCOMM_CTS) { 1075 if (status & IRCOMM_CTS) {
1076 IRDA_DEBUG(2, 1076 IRDA_DEBUG(2,
@@ -1313,7 +1313,7 @@ static void ircomm_tty_line_info(struct ircomm_tty_cb *self, struct seq_file *m)
1313 1313
1314 seq_puts(m, "Flags:"); 1314 seq_puts(m, "Flags:");
1315 sep = ' '; 1315 sep = ' ';
1316 if (self->port.flags & ASYNC_CTS_FLOW) { 1316 if (tty_port_cts_enabled(&self->port)) {
1317 seq_printf(m, "%cASYNC_CTS_FLOW", sep); 1317 seq_printf(m, "%cASYNC_CTS_FLOW", sep);
1318 sep = '|'; 1318 sep = '|';
1319 } 1319 }
diff --git a/net/irda/ircomm/ircomm_tty_attach.c b/net/irda/ircomm/ircomm_tty_attach.c
index 3ab70e7a0715..edab393e0c82 100644
--- a/net/irda/ircomm/ircomm_tty_attach.c
+++ b/net/irda/ircomm/ircomm_tty_attach.c
@@ -578,7 +578,7 @@ void ircomm_tty_link_established(struct ircomm_tty_cb *self)
578 * will have to wait for the peer device (DCE) to raise the CTS 578 * will have to wait for the peer device (DCE) to raise the CTS
579 * line. 579 * line.
580 */ 580 */
581 if ((self->port.flags & ASYNC_CTS_FLOW) && 581 if (tty_port_cts_enabled(&self->port) &&
582 ((self->settings.dce & IRCOMM_CTS) == 0)) { 582 ((self->settings.dce & IRCOMM_CTS) == 0)) {
583 IRDA_DEBUG(0, "%s(), waiting for CTS ...\n", __func__ ); 583 IRDA_DEBUG(0, "%s(), waiting for CTS ...\n", __func__ );
584 goto put; 584 goto put;