summaryrefslogtreecommitdiffstats
path: root/sound/pci/korg1212
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-01-16 16:34:20 +0100
committerJaroslav Kysela <perex@suse.cz>2006-03-22 10:25:29 +0100
commit62932df8fb20ba2fb53a95fa52445eba22e821fe (patch)
tree335178d7438395a68a453a9c23624b3e9fc5ec40 /sound/pci/korg1212
parent8b7547f95cbe8a5940df62ed730646fdfcba5fda (diff)
downloadblackbird-obmc-linux-62932df8fb20ba2fb53a95fa52445eba22e821fe.tar.gz
blackbird-obmc-linux-62932df8fb20ba2fb53a95fa52445eba22e821fe.zip
[ALSA] semaphore -> mutex (PCI part)
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: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/korg1212')
-rw-r--r--sound/pci/korg1212/korg1212.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c
index 4eddb512c12f..4721c096335e 100644
--- a/sound/pci/korg1212/korg1212.c
+++ b/sound/pci/korg1212/korg1212.c
@@ -27,6 +27,7 @@
#include <linux/slab.h>
#include <linux/wait.h>
#include <linux/moduleparam.h>
+#include <linux/mutex.h>
#include <sound/core.h>
#include <sound/info.h>
@@ -325,7 +326,7 @@ struct snd_korg1212 {
int irq;
spinlock_t lock;
- struct semaphore open_mutex;
+ struct mutex open_mutex;
struct timer_list timer; /* timer callback for checking ack of stop request */
int stop_pending_cnt; /* counter for stop pending check */
@@ -667,13 +668,13 @@ static int snd_korg1212_OpenCard(struct snd_korg1212 * korg1212)
{
K1212_DEBUG_PRINTK("K1212_DEBUG: OpenCard [%s] %d\n",
stateName[korg1212->cardState], korg1212->opencnt);
- down(&korg1212->open_mutex);
+ mutex_lock(&korg1212->open_mutex);
if (korg1212->opencnt++ == 0) {
snd_korg1212_TurnOffIdleMonitor(korg1212);
snd_korg1212_setCardState(korg1212, K1212_STATE_OPEN);
}
- up(&korg1212->open_mutex);
+ mutex_unlock(&korg1212->open_mutex);
return 1;
}
@@ -682,9 +683,9 @@ static int snd_korg1212_CloseCard(struct snd_korg1212 * korg1212)
K1212_DEBUG_PRINTK("K1212_DEBUG: CloseCard [%s] %d\n",
stateName[korg1212->cardState], korg1212->opencnt);
- down(&korg1212->open_mutex);
+ mutex_lock(&korg1212->open_mutex);
if (--(korg1212->opencnt)) {
- up(&korg1212->open_mutex);
+ mutex_unlock(&korg1212->open_mutex);
return 0;
}
@@ -695,7 +696,7 @@ static int snd_korg1212_CloseCard(struct snd_korg1212 * korg1212)
K1212_DEBUG_PRINTK("K1212_DEBUG: CloseCard - RC = %d [%s]\n",
rc, stateName[korg1212->cardState]);
if (rc != K1212_CMDRET_Success) {
- up(&korg1212->open_mutex);
+ mutex_unlock(&korg1212->open_mutex);
return 0;
}
} else if (korg1212->cardState > K1212_STATE_SETUP) {
@@ -707,7 +708,7 @@ static int snd_korg1212_CloseCard(struct snd_korg1212 * korg1212)
snd_korg1212_setCardState(korg1212, K1212_STATE_READY);
}
- up(&korg1212->open_mutex);
+ mutex_unlock(&korg1212->open_mutex);
return 0;
}
@@ -2179,7 +2180,7 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev *
init_waitqueue_head(&korg1212->wait);
spin_lock_init(&korg1212->lock);
- init_MUTEX(&korg1212->open_mutex);
+ mutex_init(&korg1212->open_mutex);
init_timer(&korg1212->timer);
korg1212->timer.function = snd_korg1212_timer_func;
korg1212->timer.data = (unsigned long)korg1212;
OpenPOWER on IntegriCloud