diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-01-16 16:29:08 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-03-22 10:24:50 +0100 |
commit | 1a60d4c5a0c4028559585a74e48593b16e1ca9b2 (patch) | |
tree | f03f8dfcd554f8ebbb295522dc46dfe4d110a484 /sound/core/oss | |
parent | f0283f45a04d5cf31512e5e390a38504d97e7a97 (diff) |
[ALSA] semaphore -> mutex (core 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/core/oss')
-rw-r--r-- | sound/core/oss/mixer_oss.c | 14 | ||||
-rw-r--r-- | sound/core/oss/pcm_oss.c | 30 |
2 files changed, 22 insertions, 22 deletions
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c index f08e65a2bffe..9c68bc3f97aa 100644 --- a/sound/core/oss/mixer_oss.c +++ b/sound/core/oss/mixer_oss.c @@ -1095,7 +1095,7 @@ static void snd_mixer_oss_proc_read(struct snd_info_entry *entry, struct snd_mixer_oss *mixer = entry->private_data; int i; - down(&mixer->reg_mutex); + mutex_lock(&mixer->reg_mutex); for (i = 0; i < SNDRV_OSS_MAX_MIXERS; i++) { struct slot *p; @@ -1110,7 +1110,7 @@ static void snd_mixer_oss_proc_read(struct snd_info_entry *entry, else snd_iprintf(buffer, "\"\" 0\n"); } - up(&mixer->reg_mutex); + mutex_unlock(&mixer->reg_mutex); } static void snd_mixer_oss_proc_write(struct snd_info_entry *entry, @@ -1134,9 +1134,9 @@ static void snd_mixer_oss_proc_write(struct snd_info_entry *entry, cptr = snd_info_get_str(str, cptr, sizeof(str)); if (! *str) { /* remove the entry */ - down(&mixer->reg_mutex); + mutex_lock(&mixer->reg_mutex); mixer_slot_clear(&mixer->slots[ch]); - up(&mixer->reg_mutex); + mutex_unlock(&mixer->reg_mutex); continue; } snd_info_get_str(idxstr, cptr, sizeof(idxstr)); @@ -1145,7 +1145,7 @@ static void snd_mixer_oss_proc_write(struct snd_info_entry *entry, snd_printk(KERN_ERR "mixer_oss: invalid index %d\n", idx); continue; } - down(&mixer->reg_mutex); + mutex_lock(&mixer->reg_mutex); slot = (struct slot *)mixer->slots[ch].private_data; if (slot && slot->assigned && slot->assigned->index == idx && ! strcmp(slot->assigned->name, str)) @@ -1168,7 +1168,7 @@ static void snd_mixer_oss_proc_write(struct snd_info_entry *entry, kfree(tbl); } __unlock: - up(&mixer->reg_mutex); + mutex_unlock(&mixer->reg_mutex); } } @@ -1288,7 +1288,7 @@ static int snd_mixer_oss_notify_handler(struct snd_card *card, int cmd) mixer = kcalloc(2, sizeof(*mixer), GFP_KERNEL); if (mixer == NULL) return -ENOMEM; - init_MUTEX(&mixer->reg_mutex); + mutex_init(&mixer->reg_mutex); sprintf(name, "mixer%i%i", card->number, 0); if ((err = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MIXER, card, 0, diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index bc24d028f518..f8302b703a30 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -1643,10 +1643,10 @@ static struct snd_pcm_oss_setup *snd_pcm_oss_look_for_setup(struct snd_pcm *pcm, const char *ptr, *ptrl; struct snd_pcm_oss_setup *setup; - down(&pcm->streams[stream].oss.setup_mutex); + mutex_lock(&pcm->streams[stream].oss.setup_mutex); for (setup = pcm->streams[stream].oss.setup_list; setup; setup = setup->next) { if (!strcmp(setup->task_name, task_name)) { - up(&pcm->streams[stream].oss.setup_mutex); + mutex_unlock(&pcm->streams[stream].oss.setup_mutex); return setup; } } @@ -1662,12 +1662,12 @@ static struct snd_pcm_oss_setup *snd_pcm_oss_look_for_setup(struct snd_pcm *pcm, } for (setup = pcm->streams[stream].oss.setup_list; setup; setup = setup->next) { if (!strcmp(setup->task_name, ptrl)) { - up(&pcm->streams[stream].oss.setup_mutex); + mutex_unlock(&pcm->streams[stream].oss.setup_mutex); return setup; } } __not_found: - up(&pcm->streams[stream].oss.setup_mutex); + mutex_unlock(&pcm->streams[stream].oss.setup_mutex); return NULL; } @@ -1895,7 +1895,7 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file) init_waitqueue_entry(&wait, current); add_wait_queue(&pcm->open_wait, &wait); - down(&pcm->open_mutex); + mutex_lock(&pcm->open_mutex); while (1) { err = snd_pcm_oss_open_file(file, pcm, &pcm_oss_file, iminor(inode), psetup, csetup); @@ -1909,16 +1909,16 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file) } else break; set_current_state(TASK_INTERRUPTIBLE); - up(&pcm->open_mutex); + mutex_unlock(&pcm->open_mutex); schedule(); - down(&pcm->open_mutex); + mutex_lock(&pcm->open_mutex); if (signal_pending(current)) { err = -ERESTARTSYS; break; } } remove_wait_queue(&pcm->open_wait, &wait); - up(&pcm->open_mutex); + mutex_unlock(&pcm->open_mutex); if (err < 0) goto __error; return err; @@ -1944,9 +1944,9 @@ static int snd_pcm_oss_release(struct inode *inode, struct file *file) snd_assert(substream != NULL, return -ENXIO); pcm = substream->pcm; snd_pcm_oss_sync(pcm_oss_file); - down(&pcm->open_mutex); + mutex_lock(&pcm->open_mutex); snd_pcm_oss_release_file(pcm_oss_file); - up(&pcm->open_mutex); + mutex_unlock(&pcm->open_mutex); wake_up(&pcm->open_wait); module_put(pcm->card->module); snd_card_file_remove(pcm->card, file); @@ -2293,7 +2293,7 @@ static void snd_pcm_oss_proc_read(struct snd_info_entry *entry, { struct snd_pcm_str *pstr = entry->private_data; struct snd_pcm_oss_setup *setup = pstr->oss.setup_list; - down(&pstr->oss.setup_mutex); + mutex_lock(&pstr->oss.setup_mutex); while (setup) { snd_iprintf(buffer, "%s %u %u%s%s%s%s%s%s\n", setup->task_name, @@ -2307,7 +2307,7 @@ static void snd_pcm_oss_proc_read(struct snd_info_entry *entry, setup->nosilence ? " no-silence" : ""); setup = setup->next; } - up(&pstr->oss.setup_mutex); + mutex_unlock(&pstr->oss.setup_mutex); } static void snd_pcm_oss_proc_free_setup_list(struct snd_pcm_str * pstr) @@ -2337,12 +2337,12 @@ static void snd_pcm_oss_proc_write(struct snd_info_entry *entry, struct snd_pcm_oss_setup *setup, *setup1, template; while (!snd_info_get_line(buffer, line, sizeof(line))) { - down(&pstr->oss.setup_mutex); + mutex_lock(&pstr->oss.setup_mutex); memset(&template, 0, sizeof(template)); ptr = snd_info_get_str(task_name, line, sizeof(task_name)); if (!strcmp(task_name, "clear") || !strcmp(task_name, "erase")) { snd_pcm_oss_proc_free_setup_list(pstr); - up(&pstr->oss.setup_mutex); + mutex_unlock(&pstr->oss.setup_mutex); continue; } for (setup = pstr->oss.setup_list; setup; setup = setup->next) { @@ -2394,7 +2394,7 @@ static void snd_pcm_oss_proc_write(struct snd_info_entry *entry, } if (setup) *setup = template; - up(&pstr->oss.setup_mutex); + mutex_unlock(&pstr->oss.setup_mutex); } } |