aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/tty_mutex.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2011-07-14 08:35:14 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-23 13:34:07 -0400
commit906cbe1364d94da7cbf74c1d05e3e78b2883f661 (patch)
treefca513a03781a2d0e2ac518aab13c8d528a0468c /drivers/tty/tty_mutex.c
parenteff4b0b9fe37873d3dc7ade0e08e6f0f89279b8b (diff)
TTY: remove tty_locked
We used it really only serial and ami_serial. The rest of the callsites were BUG/WARN_ONs to check if BTM is held. Now that we pruned tty_locked from both of the real users, we can get rid of tty_lock along with __big_tty_mutex_owner. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Acked-by: Arnd Bergmann <arnd@arndb.de> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty/tty_mutex.c')
-rw-r--r--drivers/tty/tty_mutex.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/tty/tty_mutex.c b/drivers/tty/tty_mutex.c
index 3b2bb7719442..9ff986c32a21 100644
--- a/drivers/tty/tty_mutex.c
+++ b/drivers/tty/tty_mutex.c
@@ -15,30 +15,18 @@
15 * Don't use in new code. 15 * Don't use in new code.
16 */ 16 */
17static DEFINE_MUTEX(big_tty_mutex); 17static DEFINE_MUTEX(big_tty_mutex);
18struct task_struct *__big_tty_mutex_owner;
19EXPORT_SYMBOL_GPL(__big_tty_mutex_owner);
20 18
21/* 19/*
22 * Getting the big tty mutex. 20 * Getting the big tty mutex.
23 */ 21 */
24void __lockfunc tty_lock(void) 22void __lockfunc tty_lock(void)
25{ 23{
26 struct task_struct *task = current;
27
28 WARN_ON(__big_tty_mutex_owner == task);
29
30 mutex_lock(&big_tty_mutex); 24 mutex_lock(&big_tty_mutex);
31 __big_tty_mutex_owner = task;
32} 25}
33EXPORT_SYMBOL(tty_lock); 26EXPORT_SYMBOL(tty_lock);
34 27
35void __lockfunc tty_unlock(void) 28void __lockfunc tty_unlock(void)
36{ 29{
37 struct task_struct *task = current;
38
39 WARN_ON(__big_tty_mutex_owner != task);
40 __big_tty_mutex_owner = NULL;
41
42 mutex_unlock(&big_tty_mutex); 30 mutex_unlock(&big_tty_mutex);
43} 31}
44EXPORT_SYMBOL(tty_unlock); 32EXPORT_SYMBOL(tty_unlock);