All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Subject: [PATCH 1/4] ALSA: info: Drop unused snd_info_entry.card field
Date: Tue,  5 Feb 2019 17:07:55 +0100	[thread overview]
Message-ID: <20190205160758.9172-2-tiwai@suse.de> (raw)
In-Reply-To: <20190205160758.9172-1-tiwai@suse.de>

It's referred only in snd_card_id_read() which can receive the card
object via private_data.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 include/sound/info.h | 1 -
 sound/core/info.c    | 4 +---
 sound/core/init.c    | 6 ++++--
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/include/sound/info.h b/include/sound/info.h
index 96530f7599e1..97fdda41e076 100644
--- a/include/sound/info.h
+++ b/include/sound/info.h
@@ -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);
diff --git a/sound/core/info.c b/sound/core/info.c
index 92edc9488b5b..76800326ac56 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -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);
diff --git a/sound/core/init.c b/sound/core/init.c
index 4849c611c0fe..5252a9ce13dc 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -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);
-- 
2.16.4

  reply	other threads:[~2019-02-05 16:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-05 16:07 [PATCH 0/4] ALSA: Yet more cleanups for procfs Takashi Iwai
2019-02-05 16:07 ` Takashi Iwai [this message]
2019-02-05 16:07 ` [PATCH 2/4] ALSA: info: Minor optimization Takashi Iwai
2019-02-05 17:55   ` Jaroslav Kysela
2019-02-05 19:27     ` Takashi Iwai
2019-02-05 16:07 ` [PATCH 3/4] ALSA: info: Move card id proc creation into info.c Takashi Iwai
2019-02-05 16:07 ` [PATCH 4/4] ALSA: cs46xx: Clean up proc file creations Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190205160758.9172-2-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.