hdpu_cpustate: BKL pushdown
authorArnd Bergmann <arnd@arndb.de>
Tue, 20 May 2008 17:15:57 +0000 (19:15 +0200)
committerJonathan Corbet <corbet@lwn.net>
Fri, 20 Jun 2008 20:05:57 +0000 (14:05 -0600)
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/misc/hdpuftrs/hdpu_cpustate.c

index ff51ab6..176fe4e 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/spinlock.h>
+#include <linux/smp_lock.h>
 #include <linux/miscdevice.h>
 #include <linux/proc_fs.h>
 #include <linux/hdpu_features.h>
@@ -151,7 +152,13 @@ static ssize_t cpustate_write(struct file *file, const char *buf,
 
 static int cpustate_open(struct inode *inode, struct file *file)
 {
-       return cpustate_get_ref((file->f_flags & O_EXCL));
+       int ret;
+
+       lock_kernel();
+       ret = cpustate_get_ref((file->f_flags & O_EXCL));
+       unlock_kernel();
+
+       return ret;
 }
 
 static int cpustate_release(struct inode *inode, struct file *file)