]> err.no Git - linux-2.6/blobdiff - drivers/sbus/char/flash.c
ALSA: wm8750: add missing VREF output
[linux-2.6] / drivers / sbus / char / flash.c
index 262f01e68592f4b359cef0d7c0743673cb237049..7d95e151513a0a5446e07ef6da24d9605334af53 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/init.h>
 #include <linux/smp_lock.h>
 #include <linux/spinlock.h>
+#include <linux/mm.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -126,9 +127,13 @@ flash_read(struct file * file, char __user * buf,
 static int
 flash_open(struct inode *inode, struct file *file)
 {
-       if (test_and_set_bit(0, (void *)&flash.busy) != 0)
+       lock_kernel();
+       if (test_and_set_bit(0, (void *)&flash.busy) != 0) {
+               unlock_kernel();
                return -EBUSY;
+       }
 
+       unlock_kernel();
        return 0;
 }