]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/char/mbcs.c
Merge tag 'v2.6.37' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / drivers / char / mbcs.c
index 83bef4efe37636869f418756462516d00a4f3ccd..1aeaaba680d22e1e943995efeff6b0ed671c5fe8 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/mm.h>
 #include <linux/uio.h>
 #include <linux/mutex.h>
-#include <linux/smp_lock.h>
 #include <linux/slab.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
@@ -42,6 +41,7 @@
 #else
 #define DBG(fmt...)
 #endif
+static DEFINE_MUTEX(mbcs_mutex);
 static int mbcs_major;
 
 static LIST_HEAD(soft_list);
@@ -385,19 +385,19 @@ static int mbcs_open(struct inode *ip, struct file *fp)
        struct mbcs_soft *soft;
        int minor;
 
-       lock_kernel();
+       mutex_lock(&mbcs_mutex);
        minor = iminor(ip);
 
        /* Nothing protects access to this list... */
        list_for_each_entry(soft, &soft_list, list) {
                if (soft->nasid == minor) {
                        fp->private_data = soft->cxdev;
-                       unlock_kernel();
+                       mutex_unlock(&mbcs_mutex);
                        return 0;
                }
        }
 
-       unlock_kernel();
+       mutex_unlock(&mbcs_mutex);
        return -ENODEV;
 }