]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ALSA: isa: Clean up with new procfs helpers
authorTakashi Iwai <tiwai@suse.de>
Mon, 4 Feb 2019 15:00:13 +0000 (16:00 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 6 Feb 2019 17:11:55 +0000 (18:11 +0100)
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>
sound/isa/gus/gus_irq.c
sound/isa/gus/gus_mem.c
sound/isa/opti9xx/miro.c
sound/isa/sb/sb16_csp.c

index 2055aff71b50ff4a50613a66905e007620aa876f..0ca6c38e2ed97fae71af37c9fa4963aeff52c3ce 100644 (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
index af888a022fc0807a8011a3b28f1738c6f07723de..4ac76f46dd76259629b9ea0e9e0ea1e0c02f24c5 100644 (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;
 }
index c6136c6b021474dabdd30b023fd9fb8de0d042c9..997cdfd7b1eaab6914b43c97eb42b885b16de883 100644 (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);
 }
 
 /*
index bf3db0d2ea12bfcceef9991eaa929e2d01a8e12e..a09ad57b83137b2b46ba2b7c3524de4b7a03b1c6 100644 (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;
 }