diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-03-23 03:00:39 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-23 07:38:13 -0800 |
commit | 910f5d202ce39cc78de1bbb679285a3167de9fb2 (patch) | |
tree | 2c5b55c2b141aaf016c459beb397fc702c41b967 /sound/oss/maestro3.c | |
parent | 82d4dc5adb0055393248ad4ab8de392fac708a12 (diff) | |
download | linux-910f5d202ce39cc78de1bbb679285a3167de9fb2.tar.bz2 |
[PATCH] sem2mutex: sound/oss/
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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'sound/oss/maestro3.c')
-rw-r--r-- | sound/oss/maestro3.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/sound/oss/maestro3.c b/sound/oss/maestro3.c index f3dec70fcb9b..66044aff2586 100644 --- a/sound/oss/maestro3.c +++ b/sound/oss/maestro3.c @@ -144,6 +144,8 @@ #include <linux/spinlock.h> #include <linux/ac97_codec.h> #include <linux/wait.h> +#include <linux/mutex.h> + #include <asm/io.h> #include <asm/dma.h> @@ -205,7 +207,7 @@ struct m3_state { when irqhandler uses s->lock and m3_assp_read uses card->lock ? */ - struct semaphore open_sem; + struct mutex open_mutex; wait_queue_head_t open_wait; mode_t open_mode; @@ -2013,17 +2015,17 @@ static int m3_open(struct inode *inode, struct file *file) file->private_data = s; /* wait for device to become free */ - down(&s->open_sem); + mutex_lock(&s->open_mutex); while (s->open_mode & file->f_mode) { if (file->f_flags & O_NONBLOCK) { - up(&s->open_sem); + mutex_unlock(&s->open_mutex); return -EWOULDBLOCK; } - up(&s->open_sem); + mutex_unlock(&s->open_mutex); interruptible_sleep_on(&s->open_wait); if (signal_pending(current)) return -ERESTARTSYS; - down(&s->open_sem); + mutex_lock(&s->open_mutex); } spin_lock_irqsave(&c->lock, flags); @@ -2047,7 +2049,7 @@ static int m3_open(struct inode *inode, struct file *file) set_fmt(s, fmtm, fmts); s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE); - up(&s->open_sem); + mutex_unlock(&s->open_mutex); spin_unlock_irqrestore(&c->lock, flags); return nonseekable_open(inode, file); } @@ -2062,7 +2064,7 @@ static int m3_release(struct inode *inode, struct file *file) if (file->f_mode & FMODE_WRITE) drain_dac(s, file->f_flags & O_NONBLOCK); - down(&s->open_sem); + mutex_lock(&s->open_mutex); spin_lock_irqsave(&card->lock, flags); if (file->f_mode & FMODE_WRITE) { @@ -2083,7 +2085,7 @@ static int m3_release(struct inode *inode, struct file *file) s->open_mode &= (~file->f_mode) & (FMODE_READ|FMODE_WRITE); spin_unlock_irqrestore(&card->lock, flags); - up(&s->open_sem); + mutex_unlock(&s->open_mutex); wake_up(&s->open_wait); return 0; @@ -2679,7 +2681,7 @@ static int __devinit m3_probe(struct pci_dev *pci_dev, const struct pci_device_i init_waitqueue_head(&s->dma_adc.wait); init_waitqueue_head(&s->dma_dac.wait); init_waitqueue_head(&s->open_wait); - init_MUTEX(&(s->open_sem)); + mutex_init(&(s->open_mutex)); s->magic = M3_STATE_MAGIC; m3_assp_client_init(s); |