diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-01-16 10:29:08 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-03-22 04:24:50 -0500 |
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, | |||
1095 | struct snd_mixer_oss *mixer = entry->private_data; | 1095 | struct snd_mixer_oss *mixer = entry->private_data; |
1096 | int i; | 1096 | int i; |
1097 | 1097 | ||
1098 | down(&mixer->reg_mutex); | 1098 | mutex_lock(&mixer->reg_mutex); |
1099 | for (i = 0; i < SNDRV_OSS_MAX_MIXERS; i++) { | 1099 | for (i = 0; i < SNDRV_OSS_MAX_MIXERS; i++) { |
1100 | struct slot *p; | 1100 | struct slot *p; |
1101 | 1101 | ||
@@ -1110,7 +1110,7 @@ static void snd_mixer_oss_proc_read(struct snd_info_entry *entry, | |||
1110 | else | 1110 | else |
1111 | snd_iprintf(buffer, "\"\" 0\n"); | 1111 | snd_iprintf(buffer, "\"\" 0\n"); |
1112 | } | 1112 | } |
1113 | up(&mixer->reg_mutex); | 1113 | mutex_unlock(&mixer->reg_mutex); |
1114 | } | 1114 | } |
1115 | 1115 | ||
1116 | static void snd_mixer_oss_proc_write(struct snd_info_entry *entry, | 1116 | 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, | |||
1134 | cptr = snd_info_get_str(str, cptr, sizeof(str)); | 1134 | cptr = snd_info_get_str(str, cptr, sizeof(str)); |
1135 | if (! *str) { | 1135 | if (! *str) { |
1136 | /* remove the entry */ | 1136 | /* remove the entry */ |
1137 | down(&mixer->reg_mutex); | 1137 | mutex_lock(&mixer->reg_mutex); |
1138 | mixer_slot_clear(&mixer->slots[ch]); | 1138 | mixer_slot_clear(&mixer->slots[ch]); |
1139 | up(&mixer->reg_mutex); | 1139 | mutex_unlock(&mixer->reg_mutex); |
1140 | continue; | 1140 | continue; |
1141 | } | 1141 | } |
1142 | snd_info_get_str(idxstr, cptr, sizeof(idxstr)); | 1142 | snd_info_get_str(idxstr, cptr, sizeof(idxstr)); |
@@ -1145,7 +1145,7 @@ static void snd_mixer_oss_proc_write(struct snd_info_entry *entry, | |||
1145 | snd_printk(KERN_ERR "mixer_oss: invalid index %d\n", idx); | 1145 | snd_printk(KERN_ERR "mixer_oss: invalid index %d\n", idx); |
1146 | continue; | 1146 | continue; |
1147 | } | 1147 | } |
1148 | down(&mixer->reg_mutex); | 1148 | mutex_lock(&mixer->reg_mutex); |
1149 | slot = (struct slot *)mixer->slots[ch].private_data; | 1149 | slot = (struct slot *)mixer->slots[ch].private_data; |
1150 | if (slot && slot->assigned && | 1150 | if (slot && slot->assigned && |
1151 | slot->assigned->index == idx && ! strcmp(slot->assigned->name, str)) | 1151 | 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, | |||
1168 | kfree(tbl); | 1168 | kfree(tbl); |
1169 | } | 1169 | } |
1170 | __unlock: | 1170 | __unlock: |
1171 | up(&mixer->reg_mutex); | 1171 | mutex_unlock(&mixer->reg_mutex); |
1172 | } | 1172 | } |
1173 | } | 1173 | } |
1174 | 1174 | ||
@@ -1288,7 +1288,7 @@ static int snd_mixer_oss_notify_handler(struct snd_card *card, int cmd) | |||
1288 | mixer = kcalloc(2, sizeof(*mixer), GFP_KERNEL); | 1288 | mixer = kcalloc(2, sizeof(*mixer), GFP_KERNEL); |
1289 | if (mixer == NULL) | 1289 | if (mixer == NULL) |
1290 | return -ENOMEM; | 1290 | return -ENOMEM; |
1291 | init_MUTEX(&mixer->reg_mutex); | 1291 | mutex_init(&mixer->reg_mutex); |
1292 | sprintf(name, "mixer%i%i", card->number, 0); | 1292 | sprintf(name, "mixer%i%i", card->number, 0); |
1293 | if ((err = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MIXER, | 1293 | if ((err = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MIXER, |
1294 | card, 0, | 1294 | 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, | |||
1643 | const char *ptr, *ptrl; | 1643 | const char *ptr, *ptrl; |
1644 | struct snd_pcm_oss_setup *setup; | 1644 | struct snd_pcm_oss_setup *setup; |
1645 | 1645 | ||
1646 | down(&pcm->streams[stream].oss.setup_mutex); | 1646 | mutex_lock(&pcm->streams[stream].oss.setup_mutex); |
1647 | for (setup = pcm->streams[stream].oss.setup_list; setup; setup = setup->next) { | 1647 | for (setup = pcm->streams[stream].oss.setup_list; setup; setup = setup->next) { |
1648 | if (!strcmp(setup->task_name, task_name)) { | 1648 | if (!strcmp(setup->task_name, task_name)) { |
1649 | up(&pcm->streams[stream].oss.setup_mutex); | 1649 | mutex_unlock(&pcm->streams[stream].oss.setup_mutex); |
1650 | return setup; | 1650 | return setup; |
1651 | } | 1651 | } |
1652 | } | 1652 | } |
@@ -1662,12 +1662,12 @@ static struct snd_pcm_oss_setup *snd_pcm_oss_look_for_setup(struct snd_pcm *pcm, | |||
1662 | } | 1662 | } |
1663 | for (setup = pcm->streams[stream].oss.setup_list; setup; setup = setup->next) { | 1663 | for (setup = pcm->streams[stream].oss.setup_list; setup; setup = setup->next) { |
1664 | if (!strcmp(setup->task_name, ptrl)) { | 1664 | if (!strcmp(setup->task_name, ptrl)) { |
1665 | up(&pcm->streams[stream].oss.setup_mutex); | 1665 | mutex_unlock(&pcm->streams[stream].oss.setup_mutex); |
1666 | return setup; | 1666 | return setup; |
1667 | } | 1667 | } |
1668 | } | 1668 | } |
1669 | __not_found: | 1669 | __not_found: |
1670 | up(&pcm->streams[stream].oss.setup_mutex); | 1670 | mutex_unlock(&pcm->streams[stream].oss.setup_mutex); |
1671 | return NULL; | 1671 | return NULL; |
1672 | } | 1672 | } |
1673 | 1673 | ||
@@ -1895,7 +1895,7 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file) | |||
1895 | 1895 | ||
1896 | init_waitqueue_entry(&wait, current); | 1896 | init_waitqueue_entry(&wait, current); |
1897 | add_wait_queue(&pcm->open_wait, &wait); | 1897 | add_wait_queue(&pcm->open_wait, &wait); |
1898 | down(&pcm->open_mutex); | 1898 | mutex_lock(&pcm->open_mutex); |
1899 | while (1) { | 1899 | while (1) { |
1900 | err = snd_pcm_oss_open_file(file, pcm, &pcm_oss_file, | 1900 | err = snd_pcm_oss_open_file(file, pcm, &pcm_oss_file, |
1901 | iminor(inode), psetup, csetup); | 1901 | iminor(inode), psetup, csetup); |
@@ -1909,16 +1909,16 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file) | |||
1909 | } else | 1909 | } else |
1910 | break; | 1910 | break; |
1911 | set_current_state(TASK_INTERRUPTIBLE); | 1911 | set_current_state(TASK_INTERRUPTIBLE); |
1912 | up(&pcm->open_mutex); | 1912 | mutex_unlock(&pcm->open_mutex); |
1913 | schedule(); | 1913 | schedule(); |
1914 | down(&pcm->open_mutex); | 1914 | mutex_lock(&pcm->open_mutex); |
1915 | if (signal_pending(current)) { | 1915 | if (signal_pending(current)) { |
1916 | err = -ERESTARTSYS; | 1916 | err = -ERESTARTSYS; |
1917 | break; | 1917 | break; |
1918 | } | 1918 | } |
1919 | } | 1919 | } |
1920 | remove_wait_queue(&pcm->open_wait, &wait); | 1920 | remove_wait_queue(&pcm->open_wait, &wait); |
1921 | up(&pcm->open_mutex); | 1921 | mutex_unlock(&pcm->open_mutex); |
1922 | if (err < 0) | 1922 | if (err < 0) |
1923 | goto __error; | 1923 | goto __error; |
1924 | return err; | 1924 | return err; |
@@ -1944,9 +1944,9 @@ static int snd_pcm_oss_release(struct inode *inode, struct file *file) | |||
1944 | snd_assert(substream != NULL, return -ENXIO); | 1944 | snd_assert(substream != NULL, return -ENXIO); |
1945 | pcm = substream->pcm; | 1945 | pcm = substream->pcm; |
1946 | snd_pcm_oss_sync(pcm_oss_file); | 1946 | snd_pcm_oss_sync(pcm_oss_file); |
1947 | down(&pcm->open_mutex); | 1947 | mutex_lock(&pcm->open_mutex); |
1948 | snd_pcm_oss_release_file(pcm_oss_file); | 1948 | snd_pcm_oss_release_file(pcm_oss_file); |
1949 | up(&pcm->open_mutex); | 1949 | mutex_unlock(&pcm->open_mutex); |
1950 | wake_up(&pcm->open_wait); | 1950 | wake_up(&pcm->open_wait); |
1951 | module_put(pcm->card->module); | 1951 | module_put(pcm->card->module); |
1952 | snd_card_file_remove(pcm->card, file); | 1952 | snd_card_file_remove(pcm->card, file); |
@@ -2293,7 +2293,7 @@ static void snd_pcm_oss_proc_read(struct snd_info_entry *entry, | |||
2293 | { | 2293 | { |
2294 | struct snd_pcm_str *pstr = entry->private_data; | 2294 | struct snd_pcm_str *pstr = entry->private_data; |
2295 | struct snd_pcm_oss_setup *setup = pstr->oss.setup_list; | 2295 | struct snd_pcm_oss_setup *setup = pstr->oss.setup_list; |
2296 | down(&pstr->oss.setup_mutex); | 2296 | mutex_lock(&pstr->oss.setup_mutex); |
2297 | while (setup) { | 2297 | while (setup) { |
2298 | snd_iprintf(buffer, "%s %u %u%s%s%s%s%s%s\n", | 2298 | snd_iprintf(buffer, "%s %u %u%s%s%s%s%s%s\n", |
2299 | setup->task_name, | 2299 | setup->task_name, |
@@ -2307,7 +2307,7 @@ static void snd_pcm_oss_proc_read(struct snd_info_entry *entry, | |||
2307 | setup->nosilence ? " no-silence" : ""); | 2307 | setup->nosilence ? " no-silence" : ""); |
2308 | setup = setup->next; | 2308 | setup = setup->next; |
2309 | } | 2309 | } |
2310 | up(&pstr->oss.setup_mutex); | 2310 | mutex_unlock(&pstr->oss.setup_mutex); |
2311 | } | 2311 | } |
2312 | 2312 | ||
2313 | static void snd_pcm_oss_proc_free_setup_list(struct snd_pcm_str * pstr) | 2313 | 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, | |||
2337 | struct snd_pcm_oss_setup *setup, *setup1, template; | 2337 | struct snd_pcm_oss_setup *setup, *setup1, template; |
2338 | 2338 | ||
2339 | while (!snd_info_get_line(buffer, line, sizeof(line))) { | 2339 | while (!snd_info_get_line(buffer, line, sizeof(line))) { |
2340 | down(&pstr->oss.setup_mutex); | 2340 | mutex_lock(&pstr->oss.setup_mutex); |
2341 | memset(&template, 0, sizeof(template)); | 2341 | memset(&template, 0, sizeof(template)); |
2342 | ptr = snd_info_get_str(task_name, line, sizeof(task_name)); | 2342 | ptr = snd_info_get_str(task_name, line, sizeof(task_name)); |
2343 | if (!strcmp(task_name, "clear") || !strcmp(task_name, "erase")) { | 2343 | if (!strcmp(task_name, "clear") || !strcmp(task_name, "erase")) { |
2344 | snd_pcm_oss_proc_free_setup_list(pstr); | 2344 | snd_pcm_oss_proc_free_setup_list(pstr); |
2345 | up(&pstr->oss.setup_mutex); | 2345 | mutex_unlock(&pstr->oss.setup_mutex); |
2346 | continue; | 2346 | continue; |
2347 | } | 2347 | } |
2348 | for (setup = pstr->oss.setup_list; setup; setup = setup->next) { | 2348 | 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, | |||
2394 | } | 2394 | } |
2395 | if (setup) | 2395 | if (setup) |
2396 | *setup = template; | 2396 | *setup = template; |
2397 | up(&pstr->oss.setup_mutex); | 2397 | mutex_unlock(&pstr->oss.setup_mutex); |
2398 | } | 2398 | } |
2399 | } | 2399 | } |
2400 | 2400 | ||