[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>
此提交包含在:
@@ -358,7 +358,7 @@ int snd_opl3_new(struct snd_card *card,
|
||||
opl3->hardware = hardware;
|
||||
spin_lock_init(&opl3->reg_lock);
|
||||
spin_lock_init(&opl3->timer_lock);
|
||||
init_MUTEX(&opl3->access_mutex);
|
||||
mutex_init(&opl3->access_mutex);
|
||||
|
||||
if ((err = snd_device_new(card, SNDRV_DEV_CODEC, opl3, &ops)) < 0) {
|
||||
snd_opl3_free(opl3);
|
||||
|
@@ -52,13 +52,13 @@ int snd_opl3_synth_setup(struct snd_opl3 * opl3)
|
||||
{
|
||||
int idx;
|
||||
|
||||
down(&opl3->access_mutex);
|
||||
mutex_lock(&opl3->access_mutex);
|
||||
if (opl3->used) {
|
||||
up(&opl3->access_mutex);
|
||||
mutex_unlock(&opl3->access_mutex);
|
||||
return -EBUSY;
|
||||
}
|
||||
opl3->used++;
|
||||
up(&opl3->access_mutex);
|
||||
mutex_unlock(&opl3->access_mutex);
|
||||
|
||||
snd_opl3_reset(opl3);
|
||||
|
||||
@@ -91,9 +91,9 @@ void snd_opl3_synth_cleanup(struct snd_opl3 * opl3)
|
||||
spin_unlock_irqrestore(&opl3->sys_timer_lock, flags);
|
||||
|
||||
snd_opl3_reset(opl3);
|
||||
down(&opl3->access_mutex);
|
||||
mutex_lock(&opl3->access_mutex);
|
||||
opl3->used--;
|
||||
up(&opl3->access_mutex);
|
||||
mutex_unlock(&opl3->access_mutex);
|
||||
}
|
||||
|
||||
static int snd_opl3_synth_use(void *private_data, struct snd_seq_port_subscribe * info)
|
||||
|
@@ -76,13 +76,13 @@ int snd_opl3_open(struct snd_hwdep * hw, struct file *file)
|
||||
{
|
||||
struct snd_opl3 *opl3 = hw->private_data;
|
||||
|
||||
down(&opl3->access_mutex);
|
||||
mutex_lock(&opl3->access_mutex);
|
||||
if (opl3->used) {
|
||||
up(&opl3->access_mutex);
|
||||
mutex_unlock(&opl3->access_mutex);
|
||||
return -EAGAIN;
|
||||
}
|
||||
opl3->used++;
|
||||
up(&opl3->access_mutex);
|
||||
mutex_unlock(&opl3->access_mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -179,9 +179,9 @@ int snd_opl3_release(struct snd_hwdep * hw, struct file *file)
|
||||
struct snd_opl3 *opl3 = hw->private_data;
|
||||
|
||||
snd_opl3_reset(opl3);
|
||||
down(&opl3->access_mutex);
|
||||
mutex_lock(&opl3->access_mutex);
|
||||
opl3->used--;
|
||||
up(&opl3->access_mutex);
|
||||
mutex_unlock(&opl3->access_mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
新增問題並參考
封鎖使用者