aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/nvram.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-22 13:49:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-22 13:49:54 -0400
commitc37927d4359e81b85de644f8fb08878717cf5f3f (patch)
tree25dabf2d905e1410819d1bdaba0bf5f779100d3c /drivers/char/nvram.c
parent5704e44d283e907623e3775c1262f206a2c48cf3 (diff)
parent2a48fc0ab24241755dc93bfd4f01d68efab47f5a (diff)
Merge branch 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl
* 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl: block: autoconvert trivial BKL users to private mutex drivers: autoconvert trivial BKL users to private mutex ipmi: autoconvert trivial BKL users to private mutex mac: autoconvert trivial BKL users to private mutex mtd: autoconvert trivial BKL users to private mutex scsi: autoconvert trivial BKL users to private mutex Fix up trivial conflicts (due to addition of private mutex right next to deletion of a version string) in drivers/char/pcmcia/cm40[04]0_cs.c
Diffstat (limited to 'drivers/char/nvram.c')
-rw-r--r--drivers/char/nvram.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
index 66d2917b003f..166f1e7aaa7e 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
@@ -109,10 +109,11 @@
109#include <linux/spinlock.h> 109#include <linux/spinlock.h>
110#include <linux/io.h> 110#include <linux/io.h>
111#include <linux/uaccess.h> 111#include <linux/uaccess.h>
112#include <linux/smp_lock.h> 112#include <linux/mutex.h>
113 113
114#include <asm/system.h> 114#include <asm/system.h>
115 115
116static DEFINE_MUTEX(nvram_mutex);
116static DEFINE_SPINLOCK(nvram_state_lock); 117static DEFINE_SPINLOCK(nvram_state_lock);
117static int nvram_open_cnt; /* #times opened */ 118static int nvram_open_cnt; /* #times opened */
118static int nvram_open_mode; /* special open modes */ 119static int nvram_open_mode; /* special open modes */
@@ -308,7 +309,7 @@ static long nvram_ioctl(struct file *file, unsigned int cmd,
308 if (!capable(CAP_SYS_ADMIN)) 309 if (!capable(CAP_SYS_ADMIN))
309 return -EACCES; 310 return -EACCES;
310 311
311 lock_kernel(); 312 mutex_lock(&nvram_mutex);
312 spin_lock_irq(&rtc_lock); 313 spin_lock_irq(&rtc_lock);
313 314
314 for (i = 0; i < NVRAM_BYTES; ++i) 315 for (i = 0; i < NVRAM_BYTES; ++i)
@@ -316,7 +317,7 @@ static long nvram_ioctl(struct file *file, unsigned int cmd,
316 __nvram_set_checksum(); 317 __nvram_set_checksum();
317 318
318 spin_unlock_irq(&rtc_lock); 319 spin_unlock_irq(&rtc_lock);
319 unlock_kernel(); 320 mutex_unlock(&nvram_mutex);
320 return 0; 321 return 0;
321 322
322 case NVRAM_SETCKS: 323 case NVRAM_SETCKS:
@@ -325,11 +326,11 @@ static long nvram_ioctl(struct file *file, unsigned int cmd,
325 if (!capable(CAP_SYS_ADMIN)) 326 if (!capable(CAP_SYS_ADMIN))
326 return -EACCES; 327 return -EACCES;
327 328
328 lock_kernel(); 329 mutex_lock(&nvram_mutex);
329 spin_lock_irq(&rtc_lock); 330 spin_lock_irq(&rtc_lock);
330 __nvram_set_checksum(); 331 __nvram_set_checksum();
331 spin_unlock_irq(&rtc_lock); 332 spin_unlock_irq(&rtc_lock);
332 unlock_kernel(); 333 mutex_unlock(&nvram_mutex);
333 return 0; 334 return 0;
334 335
335 default: 336 default: