diff mbox

[2/3] input: use input_mutex instead of BKL when opening input device

Message ID 1268162386-2745-2-git-send-email-cascardo@holoscopio.com
State New, archived
Headers show

Commit Message

Thadeu Lima de Souza Cascardo March 9, 2010, 7:19 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/input/input.c b/drivers/input/input.c
index 41168d5..af9c246 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -23,7 +23,6 @@ 
 #include <linux/device.h>
 #include <linux/mutex.h>
 #include <linux/rcupdate.h>
-#include <linux/smp_lock.h>
 #include "input-compat.h"
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
@@ -1881,7 +1880,7 @@  static int input_open_file(struct inode *inode, struct file *file)
 	const struct file_operations *old_fops, *new_fops = NULL;
 	int err;
 
-	lock_kernel();
+	mutex_lock(&input_mutex);
 	/* No load-on-demand here? */
 	handler = input_table[iminor(inode) >> 5];
 	if (!handler || !(new_fops = fops_get(handler->fops))) {
@@ -1909,7 +1908,7 @@  static int input_open_file(struct inode *inode, struct file *file)
 	}
 	fops_put(old_fops);
 out:
-	unlock_kernel();
+	mutex_unlock(&input_mutex);
 	return err;
 }