ALSA: info: Drop unused snd_info_entry.card field
authorTakashi Iwai <tiwai@suse.de>
Tue, 5 Feb 2019 15:10:00 +0000 (16:10 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 6 Feb 2019 17:11:58 +0000 (18:11 +0100)
It's referred only in snd_card_id_read() which can receive the card
object via private_data.

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

index 96530f7599e1bf626f55e79a42249da07698b3d2..97fdda41e0763ac57f5aa4e9cc1300d77c71702b 100644 (file)
@@ -82,7 +82,6 @@ struct snd_info_entry {
                struct snd_info_entry_ops *ops;
        } c;
        struct snd_info_entry *parent;
-       struct snd_card *card;
        struct module *module;
        void *private_data;
        void (*private_free)(struct snd_info_entry *entry);
index 6c149fa54d2dc18fca766a0b823ce6007f739e72..4d23069e7928e9ccc2318ab8de40217a4b47acdd 100644 (file)
@@ -750,10 +750,8 @@ struct snd_info_entry *snd_info_create_card_entry(struct snd_card *card,
        if (!parent)
                parent = card->proc_root;
        entry = snd_info_create_entry(name, parent);
-       if (entry) {
+       if (entry)
                entry->module = card->module;
-               entry->card = card;
-       }
        return entry;
 }
 EXPORT_SYMBOL(snd_info_create_card_entry);
index 4849c611c0fe3a94d98aa3eef778f3da5538575f..5252a9ce13dc776d0701e1c7efb879afac1b8689 100644 (file)
@@ -104,7 +104,9 @@ EXPORT_SYMBOL(snd_mixer_oss_notify_callback);
 static void snd_card_id_read(struct snd_info_entry *entry,
                             struct snd_info_buffer *buffer)
 {
-       snd_iprintf(buffer, "%s\n", entry->card->id);
+       struct snd_card *card = entry->private_data;
+
+       snd_iprintf(buffer, "%s\n", card->id);
 }
 
 static int init_info_for_card(struct snd_card *card)
@@ -116,7 +118,7 @@ static int init_info_for_card(struct snd_card *card)
                dev_dbg(card->dev, "unable to create card entry\n");
                return -ENOMEM;
        }
-       entry->c.text.read = snd_card_id_read;
+       snd_info_set_text_ops(entry, card, snd_card_id_read);
        card->proc_id = entry;
 
        return snd_info_card_register(card);