X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fcore%2Finfo_oss.c;fp=sound%2Fcore%2Finfo_oss.c;h=820f4772e44aee1b5f9075b4aca3ce06ab233bc8;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=bb2c40d0ab66cd6f890ad86ac713246c561b3c7e;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/sound/core/info_oss.c b/sound/core/info_oss.c index bb2c40d0a..820f4772e 100644 --- a/sound/core/info_oss.c +++ b/sound/core/info_oss.c @@ -28,7 +28,6 @@ #include #include #include -#include #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS) @@ -36,7 +35,7 @@ * OSS compatible part */ -static DEFINE_MUTEX(strings); +static DECLARE_MUTEX(strings); static char *snd_sndstat_strings[SNDRV_CARDS][SNDRV_OSS_INFO_DEV_COUNT]; static struct snd_info_entry *snd_sndstat_proc_entry; @@ -46,7 +45,7 @@ int snd_oss_info_register(int dev, int num, char *string) snd_assert(dev >= 0 && dev < SNDRV_OSS_INFO_DEV_COUNT, return -ENXIO); snd_assert(num >= 0 && num < SNDRV_CARDS, return -ENXIO); - mutex_lock(&strings); + down(&strings); if (string == NULL) { if ((x = snd_sndstat_strings[num][dev]) != NULL) { kfree(x); @@ -55,17 +54,15 @@ int snd_oss_info_register(int dev, int num, char *string) } else { x = kstrdup(string, GFP_KERNEL); if (x == NULL) { - mutex_unlock(&strings); + up(&strings); return -ENOMEM; } } snd_sndstat_strings[num][dev] = x; - mutex_unlock(&strings); + up(&strings); return 0; } -EXPORT_SYMBOL(snd_oss_info_register); - extern void snd_card_info_read_oss(struct snd_info_buffer *buffer); static int snd_sndstat_show_strings(struct snd_info_buffer *buf, char *id, int dev) @@ -74,7 +71,7 @@ static int snd_sndstat_show_strings(struct snd_info_buffer *buf, char *id, int d char *str; snd_iprintf(buf, "\n%s:", id); - mutex_lock(&strings); + down(&strings); for (idx = 0; idx < SNDRV_CARDS; idx++) { str = snd_sndstat_strings[idx][dev]; if (str) { @@ -85,7 +82,7 @@ static int snd_sndstat_show_strings(struct snd_info_buffer *buf, char *id, int d snd_iprintf(buf, "%i: %s\n", idx, str); } } - mutex_unlock(&strings); + up(&strings); if (ok < 0) snd_iprintf(buf, " NOT ENABLED IN CONFIG\n"); return ok; @@ -119,6 +116,7 @@ int snd_info_minor_register(void) memset(snd_sndstat_strings, 0, sizeof(snd_sndstat_strings)); if ((entry = snd_info_create_module_entry(THIS_MODULE, "sndstat", snd_oss_root)) != NULL) { + entry->c.text.read_size = 2048; entry->c.text.read = snd_sndstat_proc_read; if (snd_info_register(entry) < 0) { snd_info_free_entry(entry);