diff options
author | Jiri Slaby <jslaby@suse.cz> | 2013-03-07 07:12:30 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-18 19:24:29 -0400 |
commit | aa27a094e2c2e0cc59914e56113b860f524f4479 (patch) | |
tree | b3cfef8d8023741107e3d3bed934f2bd4d8bf189 /drivers/tty/cyclades.c | |
parent | e4408ce3c23f8451eff7a2954694598fb8fce833 (diff) |
TTY: add tty_port_tty_hangup helper
It allows for cleaning up on a considerable amount of places. They did
port_get, hangup, kref_put. Now the only thing needed is to call
tty_port_tty_hangup which does exactly that. And they can also decide
whether to consider CLOCAL or completely ignore that.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/cyclades.c')
-rw-r--r-- | drivers/tty/cyclades.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c index 345bd0e0884e..33f83fee9fae 100644 --- a/drivers/tty/cyclades.c +++ b/drivers/tty/cyclades.c | |||
@@ -1124,14 +1124,8 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo) | |||
1124 | readl(&info->u.cyz.ch_ctrl->rs_status); | 1124 | readl(&info->u.cyz.ch_ctrl->rs_status); |
1125 | if (dcd & C_RS_DCD) | 1125 | if (dcd & C_RS_DCD) |
1126 | wake_up_interruptible(&info->port.open_wait); | 1126 | wake_up_interruptible(&info->port.open_wait); |
1127 | else { | 1127 | else |
1128 | struct tty_struct *tty; | 1128 | tty_port_tty_hangup(&info->port, false); |
1129 | tty = tty_port_tty_get(&info->port); | ||
1130 | if (tty) { | ||
1131 | tty_hangup(tty); | ||
1132 | tty_kref_put(tty); | ||
1133 | } | ||
1134 | } | ||
1135 | } | 1129 | } |
1136 | break; | 1130 | break; |
1137 | case C_CM_MCTS: | 1131 | case C_CM_MCTS: |