diff options
author | Jiri Slaby <jslaby@suse.cz> | 2013-03-07 13:12:29 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-19 00:19:45 +0100 |
commit | 6aad04f21374633bd8cecf25024553d1e11a9522 (patch) | |
tree | 9e3351e53b68d158b436a737049cbe2ee01ff126 /drivers/tty/tty_port.c | |
parent | TTY: msm_smd_tty, clean up activate/shutdown (diff) | |
download | linux-6aad04f21374633bd8cecf25024553d1e11a9522.tar.xz linux-6aad04f21374633bd8cecf25024553d1e11a9522.zip |
TTY: add tty_port_tty_wakeup helper
It allows for cleaning up on a considerable amount of places. They did
port_get, wakeup, kref_put. Now the only thing needed is to call
tty_port_tty_wakeup which does exactly that.
One exception is ifx6x60 where tty_wakeup was open-coded. We now call
tty_wakeup properly there.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_port.c')
-rw-r--r-- | drivers/tty/tty_port.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c index b7ff59d3db88..8bb757c62ee2 100644 --- a/drivers/tty/tty_port.c +++ b/drivers/tty/tty_port.c @@ -233,6 +233,22 @@ void tty_port_hangup(struct tty_port *port) EXPORT_SYMBOL(tty_port_hangup); /** + * tty_port_tty_wakeup - helper to wake up a tty + * + * @port: tty port + */ +void tty_port_tty_wakeup(struct tty_port *port) +{ + struct tty_struct *tty = tty_port_tty_get(port); + + if (tty) { + tty_wakeup(tty); + tty_kref_put(tty); + } +} +EXPORT_SYMBOL_GPL(tty_port_tty_wakeup); + +/** * tty_port_carrier_raised - carrier raised check * @port: tty port * |