From 910f5d202ce39cc78de1bbb679285a3167de9fb2 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Thu, 23 Mar 2006 03:00:39 -0800 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- sound/oss/ymfpci.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'sound/oss/ymfpci.c') diff --git a/sound/oss/ymfpci.c b/sound/oss/ymfpci.c index f8bd72e46f5..bf90c124a7e 100644 --- a/sound/oss/ymfpci.c +++ b/sound/oss/ymfpci.c @@ -1918,10 +1918,10 @@ static int ymf_open(struct inode *inode, struct file *file) if (unit == NULL) return -ENODEV; - down(&unit->open_sem); + mutex_lock(&unit->open_mutex); if ((state = ymf_state_alloc(unit)) == NULL) { - up(&unit->open_sem); + mutex_unlock(&unit->open_mutex); return -ENOMEM; } list_add_tail(&state->chain, &unit->states); @@ -1956,7 +1956,7 @@ static int ymf_open(struct inode *inode, struct file *file) ymfpci_writeb(unit, YDSXGR_TIMERCTRL, (YDSXGR_TIMERCTRL_TEN|YDSXGR_TIMERCTRL_TIEN)); #endif - up(&unit->open_sem); + mutex_unlock(&unit->open_mutex); return nonseekable_open(inode, file); @@ -1974,7 +1974,7 @@ out_nodma: list_del(&state->chain); kfree(state); - up(&unit->open_sem); + mutex_unlock(&unit->open_mutex); return err; } @@ -1987,7 +1987,7 @@ static int ymf_release(struct inode *inode, struct file *file) ymfpci_writeb(unit, YDSXGR_TIMERCTRL, 0); #endif - down(&unit->open_sem); + mutex_lock(&unit->open_mutex); /* * XXX Solve the case of O_NONBLOCK close - don't deallocate here. @@ -2004,7 +2004,7 @@ static int ymf_release(struct inode *inode, struct file *file) file->private_data = NULL; /* Can you tell I programmed Solaris */ kfree(state); - up(&unit->open_sem); + mutex_unlock(&unit->open_mutex); return 0; } @@ -2532,7 +2532,7 @@ static int __devinit ymf_probe_one(struct pci_dev *pcidev, const struct pci_devi spin_lock_init(&codec->reg_lock); spin_lock_init(&codec->voice_lock); spin_lock_init(&codec->ac97_lock); - init_MUTEX(&codec->open_sem); + mutex_init(&codec->open_mutex); INIT_LIST_HEAD(&codec->states); codec->pci = pcidev; -- cgit v1.2.3-70-g09d2