diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 10:49:54 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 10:49:54 -0700 |
commit | c37927d4359e81b85de644f8fb08878717cf5f3f (patch) | |
tree | 25dabf2d905e1410819d1bdaba0bf5f779100d3c /drivers/char/nvram.c | |
parent | 5704e44d283e907623e3775c1262f206a2c48cf3 (diff) | |
parent | 2a48fc0ab24241755dc93bfd4f01d68efab47f5a (diff) | |
download | linux-c37927d4359e81b85de644f8fb08878717cf5f3f.tar.gz linux-c37927d4359e81b85de644f8fb08878717cf5f3f.tar.xz |
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.c | 11 |
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 @@ #include <linux/spinlock.h> #include <linux/io.h> #include <linux/uaccess.h> -#include <linux/smp_lock.h> +#include <linux/mutex.h> #include <asm/system.h> +static DEFINE_MUTEX(nvram_mutex); static DEFINE_SPINLOCK(nvram_state_lock); static int nvram_open_cnt; /* #times opened */ static int nvram_open_mode; /* special open modes */ @@ -308,7 +309,7 @@ static long nvram_ioctl(struct file *file, unsigned int cmd, if (!capable(CAP_SYS_ADMIN)) return -EACCES; - lock_kernel(); + mutex_lock(&nvram_mutex); spin_lock_irq(&rtc_lock); for (i = 0; i < NVRAM_BYTES; ++i) @@ -316,7 +317,7 @@ static long nvram_ioctl(struct file *file, unsigned int cmd, __nvram_set_checksum(); spin_unlock_irq(&rtc_lock); - unlock_kernel(); + mutex_unlock(&nvram_mutex); return 0; case NVRAM_SETCKS: @@ -325,11 +326,11 @@ static long nvram_ioctl(struct file *file, unsigned int cmd, if (!capable(CAP_SYS_ADMIN)) return -EACCES; - lock_kernel(); + mutex_lock(&nvram_mutex); spin_lock_irq(&rtc_lock); __nvram_set_checksum(); spin_unlock_irq(&rtc_lock); - unlock_kernel(); + mutex_unlock(&nvram_mutex); return 0; default: |