diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2013-10-03 14:17:31 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2013-10-21 23:58:37 +0200 |
commit | 64d167437e37538659e08f8cfc5ad995ed488ffc (patch) | |
tree | b3a71d15aedd77866d9602f2e7b3c26eaa00793e | |
parent | 0cee4ca79ab7b4ecc29c182f60bc7c9fc9c0d19e (diff) |
backports: add tty_port_tty_wakeup()
This is needed by ./net/bluetooth/rfcomm/tty.c
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r-- | backport/backport-include/linux/tty.h | 4 | ||||
-rw-r--r-- | backport/compat/backport-3.10.c | 19 |
2 files changed, 23 insertions, 0 deletions
diff --git a/backport/backport-include/linux/tty.h b/backport/backport-include/linux/tty.h index b1026450..7b57ca1f 100644 --- a/backport/backport-include/linux/tty.h +++ b/backport/backport-include/linux/tty.h @@ -48,4 +48,8 @@ extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, tty_register_device(driver, index, device) #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) +extern void tty_port_tty_wakeup(struct tty_port *port); +#endif + #endif /* __BACKPORT_LINUX_TTY_H */ diff --git a/backport/compat/backport-3.10.c b/backport/compat/backport-3.10.c index 5273758e..d8b3bc62 100644 --- a/backport/compat/backport-3.10.c +++ b/backport/compat/backport-3.10.c @@ -13,6 +13,7 @@ #include <linux/err.h> #include <linux/proc_fs.h> #include <linux/random.h> +#include <linux/tty.h> #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) #include <linux/init.h> @@ -90,3 +91,21 @@ unsigned int get_random_int(void) return r; } EXPORT_SYMBOL_GPL(get_random_int); + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)) +/** + * 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); +#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)) */ |