From 64d167437e37538659e08f8cfc5ad995ed488ffc Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Thu, 3 Oct 2013 14:17:31 +0200 Subject: [PATCH] backports: add tty_port_tty_wakeup() This is needed by ./net/bluetooth/rfcomm/tty.c Signed-off-by: Hauke Mehrtens --- backport/backport-include/linux/tty.h | 4 ++++ backport/compat/backport-3.10.c | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/backport/backport-include/linux/tty.h b/backport/backport-include/linux/tty.h index b1026450996b..7b57ca1f91c8 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 5273758eeae1..d8b3bc6216c7 100644 --- a/backport/compat/backport-3.10.c +++ b/backport/compat/backport-3.10.c @@ -13,6 +13,7 @@ #include #include #include +#include #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) #include @@ -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)) */ -- 2.30.2