summaryrefslogtreecommitdiffstats
path: root/drivers/tty/cyclades.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2013-03-07 13:12:30 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-18 16:24:29 -0700
commitaa27a094e2c2e0cc59914e56113b860f524f4479 (patch)
treeb3cfef8d8023741107e3d3bed934f2bd4d8bf189 /drivers/tty/cyclades.c
parente4408ce3c23f8451eff7a2954694598fb8fce833 (diff)
downloadop-kernel-dev-aa27a094e2c2e0cc59914e56113b860f524f4479.zip
op-kernel-dev-aa27a094e2c2e0cc59914e56113b860f524f4479.tar.gz
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.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c
index 345bd0e..33f83fe 100644
--- a/drivers/tty/cyclades.c
+++ b/drivers/tty/cyclades.c
@@ -1124,14 +1124,8 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo)
readl(&info->u.cyz.ch_ctrl->rs_status);
if (dcd & C_RS_DCD)
wake_up_interruptible(&info->port.open_wait);
- else {
- struct tty_struct *tty;
- tty = tty_port_tty_get(&info->port);
- if (tty) {
- tty_hangup(tty);
- tty_kref_put(tty);
- }
- }
+ else
+ tty_port_tty_hangup(&info->port, false);
}
break;
case C_CM_MCTS:
OpenPOWER on IntegriCloud