backports: add tty_port_tty_wakeup()
authorHauke Mehrtens <hauke@hauke-m.de>
Thu, 3 Oct 2013 12:17:31 +0000 (14:17 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Mon, 21 Oct 2013 21:58:37 +0000 (23:58 +0200)
This is needed by ./net/bluetooth/rfcomm/tty.c

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
backport/backport-include/linux/tty.h
backport/compat/backport-3.10.c

index b1026450996bf94a95e0a22de4a1b476851f1d06..7b57ca1f91c8b34ee77ec997b38c81e14aafa2f7 100644 (file)
@@ -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 */
index 5273758eeae14cd8626b517c91af57a7463ee2fa..d8b3bc6216c7252eeb541996f2b5b98621414279 100644 (file)
@@ -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)) */