From 62932df8fb20ba2fb53a95fa52445eba22e821fe Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Mon, 16 Jan 2006 16:34:20 +0100 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Takashi Iwai --- sound/pci/korg1212/korg1212.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'sound/pci/korg1212') 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 #include #include +#include #include #include @@ -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; -- cgit v1.2.3