ALSA: compress: Remove superfluous snd_info_register() calls
authorTakashi Iwai <tiwai@suse.de>
Mon, 4 Feb 2019 13:55:19 +0000 (14:55 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 6 Feb 2019 17:11:54 +0000 (18:11 +0100)
The calls of snd_info_register() are superfluous and should be avoided
at the procfs creation time.  They are called at the end of the whole
initialization via snd_card_register().  This patch drops such
superfluous calls.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/compress_offload.c

index f7d2b37..a1a6fd7 100644 (file)
@@ -1015,22 +1015,13 @@ static int snd_compress_proc_init(struct snd_compr *compr)
        if (!entry)
                return -ENOMEM;
        entry->mode = S_IFDIR | 0555;
-       if (snd_info_register(entry) < 0) {
-               snd_info_free_entry(entry);
-               return -ENOMEM;
-       }
        compr->proc_root = entry;
 
        entry = snd_info_create_card_entry(compr->card, "info",
                                           compr->proc_root);
-       if (entry) {
+       if (entry)
                snd_info_set_text_ops(entry, compr,
                                      snd_compress_proc_info_read);
-               if (snd_info_register(entry) < 0) {
-                       snd_info_free_entry(entry);
-                       entry = NULL;
-               }
-       }
        compr->proc_info_entry = entry;
 
        return 0;