diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-03-23 03:00:27 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-23 07:38:11 -0800 |
commit | 6f87f0deebaff2716a3ce9232f948d702690562a (patch) | |
tree | 85f532fe39be7c224635dd9ed0198668c30bafa3 /drivers/char/nwflash.c | |
parent | b1c82b5c55851bf309f4019994610789f7042757 (diff) |
[PATCH] sem2mutex: drivers/char/
Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/nwflash.c')
-rw-r--r-- | drivers/char/nwflash.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/char/nwflash.c b/drivers/char/nwflash.c index ca41d62b1d9d..8865387d3448 100644 --- a/drivers/char/nwflash.c +++ b/drivers/char/nwflash.c @@ -27,6 +27,7 @@ #include <linux/rwsem.h> #include <linux/init.h> #include <linux/smp_lock.h> +#include <linux/mutex.h> #include <asm/hardware/dec21285.h> #include <asm/io.h> @@ -56,7 +57,7 @@ static int gbWriteEnable; static int gbWriteBase64Enable; static volatile unsigned char *FLASH_BASE; static int gbFlashSize = KFLASH_SIZE; -static DECLARE_MUTEX(nwflash_sem); +static DEFINE_MUTEX(nwflash_mutex); extern spinlock_t gpio_lock; @@ -140,7 +141,7 @@ static ssize_t flash_read(struct file *file, char __user *buf, size_t size, /* * We now lock against reads and writes. --rmk */ - if (down_interruptible(&nwflash_sem)) + if (mutex_lock_interruptible(&nwflash_mutex)) return -ERESTARTSYS; ret = copy_to_user(buf, (void *)(FLASH_BASE + p), count); @@ -149,7 +150,7 @@ static ssize_t flash_read(struct file *file, char __user *buf, size_t size, *ppos += count; } else ret = -EFAULT; - up(&nwflash_sem); + mutex_unlock(&nwflash_mutex); } return ret; } @@ -188,7 +189,7 @@ static ssize_t flash_write(struct file *file, const char __user *buf, /* * We now lock against reads and writes. --rmk */ - if (down_interruptible(&nwflash_sem)) + if (mutex_lock_interruptible(&nwflash_mutex)) return -ERESTARTSYS; written = 0; @@ -277,7 +278,7 @@ static ssize_t flash_write(struct file *file, const char __user *buf, */ leds_event(led_release); - up(&nwflash_sem); + mutex_unlock(&nwflash_mutex); return written; } |