diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-01-16 10:34:20 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-03-22 04:25:29 -0500 |
commit | 62932df8fb20ba2fb53a95fa52445eba22e821fe (patch) | |
tree | 335178d7438395a68a453a9c23624b3e9fc5ec40 /sound/pci/korg1212 | |
parent | 8b7547f95cbe8a5940df62ed730646fdfcba5fda (diff) |
[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.c | 17 |
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 @@ | |||
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | #include <linux/wait.h> | 28 | #include <linux/wait.h> |
29 | #include <linux/moduleparam.h> | 29 | #include <linux/moduleparam.h> |
30 | #include <linux/mutex.h> | ||
30 | 31 | ||
31 | #include <sound/core.h> | 32 | #include <sound/core.h> |
32 | #include <sound/info.h> | 33 | #include <sound/info.h> |
@@ -325,7 +326,7 @@ struct snd_korg1212 { | |||
325 | int irq; | 326 | int irq; |
326 | 327 | ||
327 | spinlock_t lock; | 328 | spinlock_t lock; |
328 | struct semaphore open_mutex; | 329 | struct mutex open_mutex; |
329 | 330 | ||
330 | struct timer_list timer; /* timer callback for checking ack of stop request */ | 331 | struct timer_list timer; /* timer callback for checking ack of stop request */ |
331 | int stop_pending_cnt; /* counter for stop pending check */ | 332 | int stop_pending_cnt; /* counter for stop pending check */ |
@@ -667,13 +668,13 @@ static int snd_korg1212_OpenCard(struct snd_korg1212 * korg1212) | |||
667 | { | 668 | { |
668 | K1212_DEBUG_PRINTK("K1212_DEBUG: OpenCard [%s] %d\n", | 669 | K1212_DEBUG_PRINTK("K1212_DEBUG: OpenCard [%s] %d\n", |
669 | stateName[korg1212->cardState], korg1212->opencnt); | 670 | stateName[korg1212->cardState], korg1212->opencnt); |
670 | down(&korg1212->open_mutex); | 671 | mutex_lock(&korg1212->open_mutex); |
671 | if (korg1212->opencnt++ == 0) { | 672 | if (korg1212->opencnt++ == 0) { |
672 | snd_korg1212_TurnOffIdleMonitor(korg1212); | 673 | snd_korg1212_TurnOffIdleMonitor(korg1212); |
673 | snd_korg1212_setCardState(korg1212, K1212_STATE_OPEN); | 674 | snd_korg1212_setCardState(korg1212, K1212_STATE_OPEN); |
674 | } | 675 | } |
675 | 676 | ||
676 | up(&korg1212->open_mutex); | 677 | mutex_unlock(&korg1212->open_mutex); |
677 | return 1; | 678 | return 1; |
678 | } | 679 | } |
679 | 680 | ||
@@ -682,9 +683,9 @@ static int snd_korg1212_CloseCard(struct snd_korg1212 * korg1212) | |||
682 | K1212_DEBUG_PRINTK("K1212_DEBUG: CloseCard [%s] %d\n", | 683 | K1212_DEBUG_PRINTK("K1212_DEBUG: CloseCard [%s] %d\n", |
683 | stateName[korg1212->cardState], korg1212->opencnt); | 684 | stateName[korg1212->cardState], korg1212->opencnt); |
684 | 685 | ||
685 | down(&korg1212->open_mutex); | 686 | mutex_lock(&korg1212->open_mutex); |
686 | if (--(korg1212->opencnt)) { | 687 | if (--(korg1212->opencnt)) { |
687 | up(&korg1212->open_mutex); | 688 | mutex_unlock(&korg1212->open_mutex); |
688 | return 0; | 689 | return 0; |
689 | } | 690 | } |
690 | 691 | ||
@@ -695,7 +696,7 @@ static int snd_korg1212_CloseCard(struct snd_korg1212 * korg1212) | |||
695 | K1212_DEBUG_PRINTK("K1212_DEBUG: CloseCard - RC = %d [%s]\n", | 696 | K1212_DEBUG_PRINTK("K1212_DEBUG: CloseCard - RC = %d [%s]\n", |
696 | rc, stateName[korg1212->cardState]); | 697 | rc, stateName[korg1212->cardState]); |
697 | if (rc != K1212_CMDRET_Success) { | 698 | if (rc != K1212_CMDRET_Success) { |
698 | up(&korg1212->open_mutex); | 699 | mutex_unlock(&korg1212->open_mutex); |
699 | return 0; | 700 | return 0; |
700 | } | 701 | } |
701 | } else if (korg1212->cardState > K1212_STATE_SETUP) { | 702 | } else if (korg1212->cardState > K1212_STATE_SETUP) { |
@@ -707,7 +708,7 @@ static int snd_korg1212_CloseCard(struct snd_korg1212 * korg1212) | |||
707 | snd_korg1212_setCardState(korg1212, K1212_STATE_READY); | 708 | snd_korg1212_setCardState(korg1212, K1212_STATE_READY); |
708 | } | 709 | } |
709 | 710 | ||
710 | up(&korg1212->open_mutex); | 711 | mutex_unlock(&korg1212->open_mutex); |
711 | return 0; | 712 | return 0; |
712 | } | 713 | } |
713 | 714 | ||
@@ -2179,7 +2180,7 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev * | |||
2179 | 2180 | ||
2180 | init_waitqueue_head(&korg1212->wait); | 2181 | init_waitqueue_head(&korg1212->wait); |
2181 | spin_lock_init(&korg1212->lock); | 2182 | spin_lock_init(&korg1212->lock); |
2182 | init_MUTEX(&korg1212->open_mutex); | 2183 | mutex_init(&korg1212->open_mutex); |
2183 | init_timer(&korg1212->timer); | 2184 | init_timer(&korg1212->timer); |
2184 | korg1212->timer.function = snd_korg1212_timer_func; | 2185 | korg1212->timer.function = snd_korg1212_timer_func; |
2185 | korg1212->timer.data = (unsigned long)korg1212; | 2186 | korg1212->timer.data = (unsigned long)korg1212; |