diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2013-10-03 16:09:24 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2013-10-21 23:58:37 +0200 |
commit | 68909c7ea181975c146883ca0f625407ccd162bd (patch) | |
tree | 44c24bc313eea0b69a5337cb014c658b38e33b38 /backport/compat/backport-3.10.c | |
parent | 64d167437e37538659e08f8cfc5ad995ed488ffc (diff) |
backports: add tty_port_tty_hangup()
This is needed by ./net/bluetooth/rfcomm/tty.c
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'backport/compat/backport-3.10.c')
-rw-r--r-- | backport/compat/backport-3.10.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/backport/compat/backport-3.10.c b/backport/compat/backport-3.10.c index d8b3bc62..4d449607 100644 --- a/backport/compat/backport-3.10.c +++ b/backport/compat/backport-3.10.c @@ -108,4 +108,20 @@ void tty_port_tty_wakeup(struct tty_port *port) } } EXPORT_SYMBOL_GPL(tty_port_tty_wakeup); + +/** + * tty_port_tty_hangup - helper to hang up a tty + * + * @port: tty port + * @check_clocal: hang only ttys with CLOCAL unset? + */ +void tty_port_tty_hangup(struct tty_port *port, bool check_clocal) +{ + struct tty_struct *tty = tty_port_tty_get(port); + + if (tty && (!check_clocal || !C_CLOCAL(tty))) + tty_hangup(tty); + tty_kref_put(tty); +} +EXPORT_SYMBOL_GPL(tty_port_tty_hangup); #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)) */ |