aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/info_oss.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-01-16 10:29:08 -0500
committerJaroslav Kysela <perex@suse.cz>2006-03-22 04:24:50 -0500
commit1a60d4c5a0c4028559585a74e48593b16e1ca9b2 (patch)
treef03f8dfcd554f8ebbb295522dc46dfe4d110a484 /sound/core/info_oss.c
parentf0283f45a04d5cf31512e5e390a38504d97e7a97 (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/info_oss.c')
-rw-r--r--sound/core/info_oss.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sound/core/info_oss.c b/sound/core/info_oss.c
index 820f4772e44a..f9ce854b3d11 100644
--- a/sound/core/info_oss.c
+++ b/sound/core/info_oss.c
@@ -28,6 +28,7 @@
28#include <sound/info.h> 28#include <sound/info.h>
29#include <sound/version.h> 29#include <sound/version.h>
30#include <linux/utsname.h> 30#include <linux/utsname.h>
31#include <linux/mutex.h>
31 32
32#if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS) 33#if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS)
33 34
@@ -35,7 +36,7 @@
35 * OSS compatible part 36 * OSS compatible part
36 */ 37 */
37 38
38static DECLARE_MUTEX(strings); 39static DEFINE_MUTEX(strings);
39static char *snd_sndstat_strings[SNDRV_CARDS][SNDRV_OSS_INFO_DEV_COUNT]; 40static char *snd_sndstat_strings[SNDRV_CARDS][SNDRV_OSS_INFO_DEV_COUNT];
40static struct snd_info_entry *snd_sndstat_proc_entry; 41static struct snd_info_entry *snd_sndstat_proc_entry;
41 42
@@ -45,7 +46,7 @@ int snd_oss_info_register(int dev, int num, char *string)
45 46
46 snd_assert(dev >= 0 && dev < SNDRV_OSS_INFO_DEV_COUNT, return -ENXIO); 47 snd_assert(dev >= 0 && dev < SNDRV_OSS_INFO_DEV_COUNT, return -ENXIO);
47 snd_assert(num >= 0 && num < SNDRV_CARDS, return -ENXIO); 48 snd_assert(num >= 0 && num < SNDRV_CARDS, return -ENXIO);
48 down(&strings); 49 mutex_lock(&strings);
49 if (string == NULL) { 50 if (string == NULL) {
50 if ((x = snd_sndstat_strings[num][dev]) != NULL) { 51 if ((x = snd_sndstat_strings[num][dev]) != NULL) {
51 kfree(x); 52 kfree(x);
@@ -54,12 +55,12 @@ int snd_oss_info_register(int dev, int num, char *string)
54 } else { 55 } else {
55 x = kstrdup(string, GFP_KERNEL); 56 x = kstrdup(string, GFP_KERNEL);
56 if (x == NULL) { 57 if (x == NULL) {
57 up(&strings); 58 mutex_unlock(&strings);
58 return -ENOMEM; 59 return -ENOMEM;
59 } 60 }
60 } 61 }
61 snd_sndstat_strings[num][dev] = x; 62 snd_sndstat_strings[num][dev] = x;
62 up(&strings); 63 mutex_unlock(&strings);
63 return 0; 64 return 0;
64} 65}
65 66
@@ -71,7 +72,7 @@ static int snd_sndstat_show_strings(struct snd_info_buffer *buf, char *id, int d
71 char *str; 72 char *str;
72 73
73 snd_iprintf(buf, "\n%s:", id); 74 snd_iprintf(buf, "\n%s:", id);
74 down(&strings); 75 mutex_lock(&strings);
75 for (idx = 0; idx < SNDRV_CARDS; idx++) { 76 for (idx = 0; idx < SNDRV_CARDS; idx++) {
76 str = snd_sndstat_strings[idx][dev]; 77 str = snd_sndstat_strings[idx][dev];
77 if (str) { 78 if (str) {
@@ -82,7 +83,7 @@ static int snd_sndstat_show_strings(struct snd_info_buffer *buf, char *id, int d
82 snd_iprintf(buf, "%i: %s\n", idx, str); 83 snd_iprintf(buf, "%i: %s\n", idx, str);
83 } 84 }
84 } 85 }
85 up(&strings); 86 mutex_unlock(&strings);
86 if (ok < 0) 87 if (ok < 0)
87 snd_iprintf(buf, " NOT ENABLED IN CONFIG\n"); 88 snd_iprintf(buf, " NOT ENABLED IN CONFIG\n");
88 return ok; 89 return ok;