X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fcore%2Finfo_oss.c;fp=sound%2Fcore%2Finfo_oss.c;h=f9ce854b3d114b441caa08525aff8643dd4b7fff;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=f9e4ce4434543598ee4f1b898375b3999fa008b8;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/sound/core/info_oss.c b/sound/core/info_oss.c index f9e4ce443..f9ce854b3 100644 --- a/sound/core/info_oss.c +++ b/sound/core/info_oss.c @@ -22,11 +22,13 @@ #include #include #include +#include #include #include #include #include #include +#include #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS) @@ -34,9 +36,9 @@ * OSS compatible part */ -static DECLARE_MUTEX(strings); +static DEFINE_MUTEX(strings); static char *snd_sndstat_strings[SNDRV_CARDS][SNDRV_OSS_INFO_DEV_COUNT]; -static snd_info_entry_t *snd_sndstat_proc_entry; +static struct snd_info_entry *snd_sndstat_proc_entry; int snd_oss_info_register(int dev, int num, char *string) { @@ -44,33 +46,33 @@ 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); - down(&strings); + mutex_lock(&strings); if (string == NULL) { if ((x = snd_sndstat_strings[num][dev]) != NULL) { kfree(x); x = NULL; } } else { - x = snd_kmalloc_strdup(string, GFP_KERNEL); + x = kstrdup(string, GFP_KERNEL); if (x == NULL) { - up(&strings); + mutex_unlock(&strings); return -ENOMEM; } } snd_sndstat_strings[num][dev] = x; - up(&strings); + mutex_unlock(&strings); return 0; } -extern void snd_card_info_read_oss(snd_info_buffer_t * buffer); +extern void snd_card_info_read_oss(struct snd_info_buffer *buffer); -static int snd_sndstat_show_strings(snd_info_buffer_t * buf, char *id, int dev) +static int snd_sndstat_show_strings(struct snd_info_buffer *buf, char *id, int dev) { int idx, ok = -1; char *str; snd_iprintf(buf, "\n%s:", id); - down(&strings); + mutex_lock(&strings); for (idx = 0; idx < SNDRV_CARDS; idx++) { str = snd_sndstat_strings[idx][dev]; if (str) { @@ -81,13 +83,14 @@ static int snd_sndstat_show_strings(snd_info_buffer_t * buf, char *id, int dev) snd_iprintf(buf, "%i: %s\n", idx, str); } } - up(&strings); + mutex_unlock(&strings); if (ok < 0) snd_iprintf(buf, " NOT ENABLED IN CONFIG\n"); return ok; } -static void snd_sndstat_proc_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer) +static void snd_sndstat_proc_read(struct snd_info_entry *entry, + struct snd_info_buffer *buffer) { snd_iprintf(buffer, "Sound Driver:3.8.1a-980706 (ALSA v" CONFIG_SND_VERSION " emulation code)\n"); snd_iprintf(buffer, "Kernel: %s %s %s %s %s\n", @@ -110,7 +113,7 @@ static void snd_sndstat_proc_read(snd_info_entry_t *entry, snd_info_buffer_t * b int snd_info_minor_register(void) { - snd_info_entry_t *entry; + struct snd_info_entry *entry; memset(snd_sndstat_strings, 0, sizeof(snd_sndstat_strings)); if ((entry = snd_info_create_module_entry(THIS_MODULE, "sndstat", snd_oss_root)) != NULL) {