diff options
Diffstat (limited to 'sound/pci/korg1212/korg1212.c')
-rw-r--r-- | sound/pci/korg1212/korg1212.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c index 4eddb51..4721c09 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; |