From patchwork Tue Feb 5 16:07:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 10797651 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 62E4B186D for ; Tue, 5 Feb 2019 16:16:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C5052C625 for ; Tue, 5 Feb 2019 16:16:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40D762C5FD; Tue, 5 Feb 2019 16:16:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62E072BE00 for ; Tue, 5 Feb 2019 16:16:20 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id DD4FA2674C5; Tue, 5 Feb 2019 17:08:05 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id B507F267900; Tue, 5 Feb 2019 17:08:03 +0100 (CET) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 4CB5A2674C5 for ; Tue, 5 Feb 2019 17:08:01 +0100 (CET) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CB572B67F; Tue, 5 Feb 2019 16:08:00 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Tue, 5 Feb 2019 17:07:55 +0100 Message-Id: <20190205160758.9172-2-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190205160758.9172-1-tiwai@suse.de> References: <20190205160758.9172-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 1/4] ALSA: info: Drop unused snd_info_entry.card field X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP It's referred only in snd_card_id_read() which can receive the card object via private_data. Signed-off-by: Takashi Iwai --- 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);