aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2008-05-20 13:16:26 -0400
committerJonathan Corbet <corbet@lwn.net>2008-07-02 17:06:23 -0400
commit930ab4e532623795f934467c452a8c71be2c30fe (patch)
treea17dc331afeeddb2533d20bcd5f66821da919421 /drivers/char
parentfd3e05b6c82ebee06f888482975172028e89382d (diff)
nvram: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/nvram.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
index 98dec380af49..197cd7a0c332 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
@@ -107,6 +107,7 @@
107#include <linux/init.h> 107#include <linux/init.h>
108#include <linux/proc_fs.h> 108#include <linux/proc_fs.h>
109#include <linux/spinlock.h> 109#include <linux/spinlock.h>
110#include <linux/smp_lock.h>
110 111
111#include <asm/io.h> 112#include <asm/io.h>
112#include <asm/uaccess.h> 113#include <asm/uaccess.h>
@@ -333,12 +334,14 @@ nvram_ioctl(struct inode *inode, struct file *file,
333static int 334static int
334nvram_open(struct inode *inode, struct file *file) 335nvram_open(struct inode *inode, struct file *file)
335{ 336{
337 lock_kernel();
336 spin_lock(&nvram_state_lock); 338 spin_lock(&nvram_state_lock);
337 339
338 if ((nvram_open_cnt && (file->f_flags & O_EXCL)) || 340 if ((nvram_open_cnt && (file->f_flags & O_EXCL)) ||
339 (nvram_open_mode & NVRAM_EXCL) || 341 (nvram_open_mode & NVRAM_EXCL) ||
340 ((file->f_mode & 2) && (nvram_open_mode & NVRAM_WRITE))) { 342 ((file->f_mode & 2) && (nvram_open_mode & NVRAM_WRITE))) {
341 spin_unlock(&nvram_state_lock); 343 spin_unlock(&nvram_state_lock);
344 unlock_kernel();
342 return -EBUSY; 345 return -EBUSY;
343 } 346 }
344 347
@@ -349,6 +352,7 @@ nvram_open(struct inode *inode, struct file *file)
349 nvram_open_cnt++; 352 nvram_open_cnt++;
350 353
351 spin_unlock(&nvram_state_lock); 354 spin_unlock(&nvram_state_lock);
355 unlock_kernel();
352 356
353 return 0; 357 return 0;
354} 358}