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: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2019-02-04 16:00:13 +01:00
parent 815d808c7b
commit 1bac5e1c81
4 changed files with 5 additions and 16 deletions

View File

@ -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)
{
struct snd_info_entry *entry;
if (! snd_card_proc_new(gus->card, "gusirq", &entry))
snd_info_set_text_ops(entry, gus, snd_gus_irq_info_read);
snd_card_ro_proc_new(gus->card, "gusirq", gus, snd_gus_irq_info_read);
}
#endif

View File

@ -238,9 +238,6 @@ int snd_gf1_mem_init(struct snd_gus_card * gus)
{
struct snd_gf1_mem *alloc;
struct snd_gf1_mem_block block;
#ifdef CONFIG_SND_DEBUG
struct snd_info_entry *entry;
#endif
alloc = &gus->gf1.mem_alloc;
mutex_init(&alloc->memory_mutex);
@ -263,8 +260,7 @@ int snd_gf1_mem_init(struct snd_gus_card * gus)
if (snd_gf1_mem_xalloc(alloc, &block) == NULL)
return -ENOMEM;
#ifdef CONFIG_SND_DEBUG
if (! snd_card_proc_new(gus->card, "gusmem", &entry))
snd_info_set_text_ops(entry, gus, snd_gf1_mem_info_read);
snd_card_ro_proc_new(gus->card, "gusmem", gus, snd_gf1_mem_info_read);
#endif
return 0;
}

View File

@ -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,
struct snd_miro *miro)
{
struct snd_info_entry *entry;
if (!snd_card_proc_new(card, "miro", &entry))
snd_info_set_text_ops(entry, miro, snd_miro_proc_read);
snd_card_ro_proc_new(card, "miro", miro, snd_miro_proc_read);
}
/*

View File

@ -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)
{
char name[16];
struct snd_info_entry *entry;
sprintf(name, "cspD%d", device);
if (! snd_card_proc_new(p->chip->card, name, &entry))
snd_info_set_text_ops(entry, p, info_read);
snd_card_ro_proc_new(p->chip->card, name, p, info_read);
return 0;
}