aboutsummaryrefslogtreecommitdiffstats
path: root/sound/drivers/opl3
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-01-16 10:31:42 -0500
committerJaroslav Kysela <perex@suse.cz>2006-03-22 04:24:57 -0500
commitef9f0a42db987e7e2df72289fb4522d24027786b (patch)
tree34f3ad0c1abdbeb6df5a1d5137db6b4f34695f5a /sound/drivers/opl3
parent1a60d4c5a0c4028559585a74e48593b16e1ca9b2 (diff)
[ALSA] semaphore -> mutex (driver 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/drivers/opl3')
-rw-r--r--sound/drivers/opl3/opl3_lib.c2
-rw-r--r--sound/drivers/opl3/opl3_seq.c10
-rw-r--r--sound/drivers/opl3/opl3_synth.c10
3 files changed, 11 insertions, 11 deletions
diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c
index 1e0c76b9acfc..4f8556976774 100644
--- a/sound/drivers/opl3/opl3_lib.c
+++ b/sound/drivers/opl3/opl3_lib.c
@@ -358,7 +358,7 @@ int snd_opl3_new(struct snd_card *card,
358 opl3->hardware = hardware; 358 opl3->hardware = hardware;
359 spin_lock_init(&opl3->reg_lock); 359 spin_lock_init(&opl3->reg_lock);
360 spin_lock_init(&opl3->timer_lock); 360 spin_lock_init(&opl3->timer_lock);
361 init_MUTEX(&opl3->access_mutex); 361 mutex_init(&opl3->access_mutex);
362 362
363 if ((err = snd_device_new(card, SNDRV_DEV_CODEC, opl3, &ops)) < 0) { 363 if ((err = snd_device_new(card, SNDRV_DEV_CODEC, opl3, &ops)) < 0) {
364 snd_opl3_free(opl3); 364 snd_opl3_free(opl3);
diff --git a/sound/drivers/opl3/opl3_seq.c b/sound/drivers/opl3/opl3_seq.c
index c4ead790008a..e26556d500e5 100644
--- a/sound/drivers/opl3/opl3_seq.c
+++ b/sound/drivers/opl3/opl3_seq.c
@@ -52,13 +52,13 @@ int snd_opl3_synth_setup(struct snd_opl3 * opl3)
52{ 52{
53 int idx; 53 int idx;
54 54
55 down(&opl3->access_mutex); 55 mutex_lock(&opl3->access_mutex);
56 if (opl3->used) { 56 if (opl3->used) {
57 up(&opl3->access_mutex); 57 mutex_unlock(&opl3->access_mutex);
58 return -EBUSY; 58 return -EBUSY;
59 } 59 }
60 opl3->used++; 60 opl3->used++;
61 up(&opl3->access_mutex); 61 mutex_unlock(&opl3->access_mutex);
62 62
63 snd_opl3_reset(opl3); 63 snd_opl3_reset(opl3);
64 64
@@ -91,9 +91,9 @@ void snd_opl3_synth_cleanup(struct snd_opl3 * opl3)
91 spin_unlock_irqrestore(&opl3->sys_timer_lock, flags); 91 spin_unlock_irqrestore(&opl3->sys_timer_lock, flags);
92 92
93 snd_opl3_reset(opl3); 93 snd_opl3_reset(opl3);
94 down(&opl3->access_mutex); 94 mutex_lock(&opl3->access_mutex);
95 opl3->used--; 95 opl3->used--;
96 up(&opl3->access_mutex); 96 mutex_unlock(&opl3->access_mutex);
97} 97}
98 98
99static int snd_opl3_synth_use(void *private_data, struct snd_seq_port_subscribe * info) 99static int snd_opl3_synth_use(void *private_data, struct snd_seq_port_subscribe * info)
diff --git a/sound/drivers/opl3/opl3_synth.c b/sound/drivers/opl3/opl3_synth.c
index 3534a0e3342a..6db503f025b3 100644
--- a/sound/drivers/opl3/opl3_synth.c
+++ b/sound/drivers/opl3/opl3_synth.c
@@ -76,13 +76,13 @@ int snd_opl3_open(struct snd_hwdep * hw, struct file *file)
76{ 76{
77 struct snd_opl3 *opl3 = hw->private_data; 77 struct snd_opl3 *opl3 = hw->private_data;
78 78
79 down(&opl3->access_mutex); 79 mutex_lock(&opl3->access_mutex);
80 if (opl3->used) { 80 if (opl3->used) {
81 up(&opl3->access_mutex); 81 mutex_unlock(&opl3->access_mutex);
82 return -EAGAIN; 82 return -EAGAIN;
83 } 83 }
84 opl3->used++; 84 opl3->used++;
85 up(&opl3->access_mutex); 85 mutex_unlock(&opl3->access_mutex);
86 86
87 return 0; 87 return 0;
88} 88}
@@ -179,9 +179,9 @@ int snd_opl3_release(struct snd_hwdep * hw, struct file *file)
179 struct snd_opl3 *opl3 = hw->private_data; 179 struct snd_opl3 *opl3 = hw->private_data;
180 180
181 snd_opl3_reset(opl3); 181 snd_opl3_reset(opl3);
182 down(&opl3->access_mutex); 182 mutex_lock(&opl3->access_mutex);
183 opl3->used--; 183 opl3->used--;
184 up(&opl3->access_mutex); 184 mutex_unlock(&opl3->access_mutex);
185 185
186 return 0; 186 return 0;
187} 187}