[PATCH] compat: add tty_{un}lock() for kernel < 3.7

Subsystems: the rest

STALE5112d

2 messages, 2 authors, 2012-08-14 · open the first message on its own page

[PATCH] compat: add tty_{un}lock() for kernel < 3.7

From: Hauke Mehrtens <hauke@hauke-m.de>
Date: 2012-08-13 19:59:12

The change of tty_{un}lock() in kernel 3.5 was reverted, but now it was
added again for kernel 3.7.

This patch does the needed changes to backport this commit:
commit 89c8d91e31f267703e365593f6bfebb9f6d2ad01
Author: Alan Cox [off-list ref]
Date:   Wed Aug 8 16:30:13 2012 +0100

    tty: localise the lock

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 include/linux/compat-3.5.h |    5 -----
 include/linux/compat-3.7.h |    5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/linux/compat-3.5.h b/include/linux/compat-3.5.h
index 3aec3bd..9cffead 100644
--- a/include/linux/compat-3.5.h
+++ b/include/linux/compat-3.5.h
@@ -239,11 +239,6 @@ struct tc_fq_codel_xstats {
 };
 #endif /* TCA_CODEL_MAX */
 
-
-/* Backports tty_lock: Localise the lock */
-#define tty_lock(__tty) tty_lock()
-#define tty_unlock(__tty) tty_unlock()
-
 /* Backport ether_addr_equal */
 static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
 {
diff --git a/include/linux/compat-3.7.h b/include/linux/compat-3.7.h
index e113e80..9271c2e 100644
--- a/include/linux/compat-3.7.h
+++ b/include/linux/compat-3.7.h
@@ -6,10 +6,15 @@
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
 
 #include <linux/workqueue.h>
+#include <linux/tty.h>
 
 bool mod_delayed_work(struct workqueue_struct *wq, struct delayed_work *dwork,
 		      unsigned long delay);
 
+/* Backports tty_lock: Localise the lock */
+#define tty_lock(__tty) tty_lock()
+#define tty_unlock(__tty) tty_unlock()
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) */
 
 #endif /* LINUX_3_7_COMPAT_H */
-- 
1.7.9.5

Re: [PATCH] compat: add tty_{un}lock() for kernel < 3.7

From: Luis R. Rodriguez <hidden>
Date: 2012-08-14 01:29:22

On Mon, Aug 13, 2012 at 12:59 PM, Hauke Mehrtens [off-list ref] wrote:
The change of tty_{un}lock() in kernel 3.5 was reverted, but now it was
added again for kernel 3.7.

This patch does the needed changes to backport this commit:
commit 89c8d91e31f267703e365593f6bfebb9f6d2ad01
Author: Alan Cox [off-list ref]
Date:   Wed Aug 8 16:30:13 2012 +0100

    tty: localise the lock

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Applied, and pushed, thanks so much!

  Luis
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help