Commit 1bac5e1c authored by Takashi Iwai's avatar Takashi Iwai

ALSA: isa: Clean up with new procfs helpers

Simplify the proc fs creation code with new helper functions,
snd_card_ro_proc_new() and snd_card_rw_proc_new().
Just a code refactoring and no functional changes.
Reviewed-by: default avatarJaroslav Kysela <perex@perex.cz>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 815d808c
...@@ -140,10 +140,7 @@ static void snd_gus_irq_info_read(struct snd_info_entry *entry, ...@@ -140,10 +140,7 @@ static void snd_gus_irq_info_read(struct snd_info_entry *entry,
void snd_gus_irq_profile_init(struct snd_gus_card *gus) void snd_gus_irq_profile_init(struct snd_gus_card *gus)
{ {
struct snd_info_entry *entry; snd_card_ro_proc_new(gus->card, "gusirq", gus, snd_gus_irq_info_read);
if (! snd_card_proc_new(gus->card, "gusirq", &entry))
snd_info_set_text_ops(entry, gus, snd_gus_irq_info_read);
} }
#endif #endif
...@@ -238,9 +238,6 @@ int snd_gf1_mem_init(struct snd_gus_card * gus) ...@@ -238,9 +238,6 @@ int snd_gf1_mem_init(struct snd_gus_card * gus)
{ {
struct snd_gf1_mem *alloc; struct snd_gf1_mem *alloc;
struct snd_gf1_mem_block block; struct snd_gf1_mem_block block;
#ifdef CONFIG_SND_DEBUG
struct snd_info_entry *entry;
#endif
alloc = &gus->gf1.mem_alloc; alloc = &gus->gf1.mem_alloc;
mutex_init(&alloc->memory_mutex); mutex_init(&alloc->memory_mutex);
...@@ -263,8 +260,7 @@ int snd_gf1_mem_init(struct snd_gus_card * gus) ...@@ -263,8 +260,7 @@ int snd_gf1_mem_init(struct snd_gus_card * gus)
if (snd_gf1_mem_xalloc(alloc, &block) == NULL) if (snd_gf1_mem_xalloc(alloc, &block) == NULL)
return -ENOMEM; return -ENOMEM;
#ifdef CONFIG_SND_DEBUG #ifdef CONFIG_SND_DEBUG
if (! snd_card_proc_new(gus->card, "gusmem", &entry)) snd_card_ro_proc_new(gus->card, "gusmem", gus, snd_gf1_mem_info_read);
snd_info_set_text_ops(entry, gus, snd_gf1_mem_info_read);
#endif #endif
return 0; return 0;
} }
......
...@@ -997,10 +997,7 @@ static void snd_miro_proc_read(struct snd_info_entry * entry, ...@@ -997,10 +997,7 @@ static void snd_miro_proc_read(struct snd_info_entry * entry,
static void snd_miro_proc_init(struct snd_card *card, static void snd_miro_proc_init(struct snd_card *card,
struct snd_miro *miro) struct snd_miro *miro)
{ {
struct snd_info_entry *entry; snd_card_ro_proc_new(card, "miro", miro, snd_miro_proc_read);
if (!snd_card_proc_new(card, "miro", &entry))
snd_info_set_text_ops(entry, miro, snd_miro_proc_read);
} }
/* /*
......
...@@ -1126,10 +1126,9 @@ static int snd_sb_csp_qsound_transfer(struct snd_sb_csp * p) ...@@ -1126,10 +1126,9 @@ static int snd_sb_csp_qsound_transfer(struct snd_sb_csp * p)
static int init_proc_entry(struct snd_sb_csp * p, int device) static int init_proc_entry(struct snd_sb_csp * p, int device)
{ {
char name[16]; char name[16];
struct snd_info_entry *entry;
sprintf(name, "cspD%d", device); sprintf(name, "cspD%d", device);
if (! snd_card_proc_new(p->chip->card, name, &entry)) snd_card_ro_proc_new(p->chip->card, name, p, info_read);
snd_info_set_text_ops(entry, p, info_read);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment