From patchwork Tue Feb 5 16:05:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 10797663 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 C0EFD186E for ; Tue, 5 Feb 2019 16:16:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFDE52BA78 for ; Tue, 5 Feb 2019 16:16:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A414F2BBA8; Tue, 5 Feb 2019 16:16:22 +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 6C0172BE05 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 D83D7267471; Tue, 5 Feb 2019 17:05:42 +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 3714B267488; Tue, 5 Feb 2019 17:05:37 +0100 (CET) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id C21832674B6 for ; Tue, 5 Feb 2019 17:05:32 +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 DF4F1B67D; Tue, 5 Feb 2019 16:05:31 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Tue, 5 Feb 2019 17:05:25 +0100 Message-Id: <20190205160527.8815-2-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190205160527.8815-1-tiwai@suse.de> References: <20190205160527.8815-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 1/3] ALSA: firewire: Remove superfluous snd_info_register() calls 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 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. Signed-off-by: Takashi Iwai Reviewed-by: Takashi Sakamoto Tested-by: Takashi Sakamoto --- sound/firewire/bebob/bebob_proc.c | 12 ++---------- sound/firewire/dice/dice-proc.c | 12 ++---------- sound/firewire/digi00x/digi00x-proc.c | 16 ++-------------- sound/firewire/fireface/ff-proc.c | 12 ++---------- sound/firewire/fireworks/fireworks_proc.c | 12 ++---------- sound/firewire/motu/motu-proc.c | 12 ++---------- sound/firewire/oxfw/oxfw-proc.c | 12 ++---------- sound/firewire/tascam/tascam-proc.c | 12 ++---------- 8 files changed, 16 insertions(+), 84 deletions(-) diff --git a/sound/firewire/bebob/bebob_proc.c b/sound/firewire/bebob/bebob_proc.c index 8096891af913..05e2a1c6326c 100644 --- a/sound/firewire/bebob/bebob_proc.c +++ b/sound/firewire/bebob/bebob_proc.c @@ -163,12 +163,8 @@ add_node(struct snd_bebob *bebob, struct snd_info_entry *root, const char *name, struct snd_info_entry *entry; entry = snd_info_create_card_entry(bebob->card, name, root); - if (entry == NULL) - return; - - snd_info_set_text_ops(entry, bebob, op); - if (snd_info_register(entry) < 0) - snd_info_free_entry(entry); + if (entry) + snd_info_set_text_ops(entry, bebob, op); } void snd_bebob_proc_init(struct snd_bebob *bebob) @@ -184,10 +180,6 @@ void snd_bebob_proc_init(struct snd_bebob *bebob) if (root == NULL) return; root->mode = S_IFDIR | 0555; - if (snd_info_register(root) < 0) { - snd_info_free_entry(root); - return; - } add_node(bebob, root, "clock", proc_read_clock); add_node(bebob, root, "firmware", proc_read_hw_info); diff --git a/sound/firewire/dice/dice-proc.c b/sound/firewire/dice/dice-proc.c index bb870fc73f99..9b1d509c6320 100644 --- a/sound/firewire/dice/dice-proc.c +++ b/sound/firewire/dice/dice-proc.c @@ -285,12 +285,8 @@ static void add_node(struct snd_dice *dice, struct snd_info_entry *root, struct snd_info_entry *entry; entry = snd_info_create_card_entry(dice->card, name, root); - if (!entry) - return; - - snd_info_set_text_ops(entry, dice, op); - if (snd_info_register(entry) < 0) - snd_info_free_entry(entry); + if (entry) + snd_info_set_text_ops(entry, dice, op); } void snd_dice_create_proc(struct snd_dice *dice) @@ -306,10 +302,6 @@ void snd_dice_create_proc(struct snd_dice *dice) if (!root) return; root->mode = S_IFDIR | 0555; - if (snd_info_register(root) < 0) { - snd_info_free_entry(root); - return; - } add_node(dice, root, "dice", dice_proc_read); add_node(dice, root, "formation", dice_proc_read_formation); diff --git a/sound/firewire/digi00x/digi00x-proc.c b/sound/firewire/digi00x/digi00x-proc.c index 6996d5a6ff5f..d22e8675b10f 100644 --- a/sound/firewire/digi00x/digi00x-proc.c +++ b/sound/firewire/digi00x/digi00x-proc.c @@ -80,20 +80,8 @@ void snd_dg00x_proc_init(struct snd_dg00x *dg00x) return; root->mode = S_IFDIR | 0555; - if (snd_info_register(root) < 0) { - snd_info_free_entry(root); - return; - } entry = snd_info_create_card_entry(dg00x->card, "clock", root); - if (entry == NULL) { - snd_info_free_entry(root); - return; - } - - snd_info_set_text_ops(entry, dg00x, proc_read_clock); - if (snd_info_register(entry) < 0) { - snd_info_free_entry(entry); - snd_info_free_entry(root); - } + if (entry) + snd_info_set_text_ops(entry, dg00x, proc_read_clock); } diff --git a/sound/firewire/fireface/ff-proc.c b/sound/firewire/fireface/ff-proc.c index a55e68ec1832..b886b541c94b 100644 --- a/sound/firewire/fireface/ff-proc.c +++ b/sound/firewire/fireface/ff-proc.c @@ -41,12 +41,8 @@ static void add_node(struct snd_ff *ff, struct snd_info_entry *root, struct snd_info_entry *entry; entry = snd_info_create_card_entry(ff->card, name, root); - if (entry == NULL) - return; - - snd_info_set_text_ops(entry, ff, op); - if (snd_info_register(entry) < 0) - snd_info_free_entry(entry); + if (entry) + snd_info_set_text_ops(entry, ff, op); } void snd_ff_proc_init(struct snd_ff *ff) @@ -62,10 +58,6 @@ void snd_ff_proc_init(struct snd_ff *ff) if (root == NULL) return; root->mode = S_IFDIR | 0555; - if (snd_info_register(root) < 0) { - snd_info_free_entry(root); - return; - } add_node(ff, root, "status", proc_dump_status); } diff --git a/sound/firewire/fireworks/fireworks_proc.c b/sound/firewire/fireworks/fireworks_proc.c index 779ecec5af62..9fa5c34a9572 100644 --- a/sound/firewire/fireworks/fireworks_proc.c +++ b/sound/firewire/fireworks/fireworks_proc.c @@ -199,12 +199,8 @@ add_node(struct snd_efw *efw, struct snd_info_entry *root, const char *name, struct snd_info_entry *entry; entry = snd_info_create_card_entry(efw->card, name, root); - if (entry == NULL) - return; - - snd_info_set_text_ops(entry, efw, op); - if (snd_info_register(entry) < 0) - snd_info_free_entry(entry); + if (entry) + snd_info_set_text_ops(entry, efw, op); } void snd_efw_proc_init(struct snd_efw *efw) @@ -220,10 +216,6 @@ void snd_efw_proc_init(struct snd_efw *efw) if (root == NULL) return; root->mode = S_IFDIR | 0555; - if (snd_info_register(root) < 0) { - snd_info_free_entry(root); - return; - } add_node(efw, root, "clock", proc_read_clock); add_node(efw, root, "firmware", proc_read_hwinfo); diff --git a/sound/firewire/motu/motu-proc.c b/sound/firewire/motu/motu-proc.c index ab6830a6d242..94327853620a 100644 --- a/sound/firewire/motu/motu-proc.c +++ b/sound/firewire/motu/motu-proc.c @@ -87,12 +87,8 @@ static void add_node(struct snd_motu *motu, struct snd_info_entry *root, struct snd_info_entry *entry; entry = snd_info_create_card_entry(motu->card, name, root); - if (entry == NULL) - return; - - snd_info_set_text_ops(entry, motu, op); - if (snd_info_register(entry) < 0) - snd_info_free_entry(entry); + if (entry) + snd_info_set_text_ops(entry, motu, op); } void snd_motu_proc_init(struct snd_motu *motu) @@ -108,10 +104,6 @@ void snd_motu_proc_init(struct snd_motu *motu) if (root == NULL) return; root->mode = S_IFDIR | 0555; - if (snd_info_register(root) < 0) { - snd_info_free_entry(root); - return; - } add_node(motu, root, "clock", proc_read_clock); add_node(motu, root, "format", proc_read_format); diff --git a/sound/firewire/oxfw/oxfw-proc.c b/sound/firewire/oxfw/oxfw-proc.c index 27dac071bc73..644107e3782e 100644 --- a/sound/firewire/oxfw/oxfw-proc.c +++ b/sound/firewire/oxfw/oxfw-proc.c @@ -83,12 +83,8 @@ static void add_node(struct snd_oxfw *oxfw, struct snd_info_entry *root, struct snd_info_entry *entry; entry = snd_info_create_card_entry(oxfw->card, name, root); - if (entry == NULL) - return; - - snd_info_set_text_ops(entry, oxfw, op); - if (snd_info_register(entry) < 0) - snd_info_free_entry(entry); + if (entry) + snd_info_set_text_ops(entry, oxfw, op); } void snd_oxfw_proc_init(struct snd_oxfw *oxfw) @@ -104,10 +100,6 @@ void snd_oxfw_proc_init(struct snd_oxfw *oxfw) if (root == NULL) return; root->mode = S_IFDIR | 0555; - if (snd_info_register(root) < 0) { - snd_info_free_entry(root); - return; - } add_node(oxfw, root, "formation", proc_read_formation); } diff --git a/sound/firewire/tascam/tascam-proc.c b/sound/firewire/tascam/tascam-proc.c index fee3bf32a0da..8bc8d277394a 100644 --- a/sound/firewire/tascam/tascam-proc.c +++ b/sound/firewire/tascam/tascam-proc.c @@ -58,12 +58,8 @@ static void add_node(struct snd_tscm *tscm, struct snd_info_entry *root, struct snd_info_entry *entry; entry = snd_info_create_card_entry(tscm->card, name, root); - if (entry == NULL) - return; - - snd_info_set_text_ops(entry, tscm, op); - if (snd_info_register(entry) < 0) - snd_info_free_entry(entry); + if (entry) + snd_info_set_text_ops(entry, tscm, op); } void snd_tscm_proc_init(struct snd_tscm *tscm) @@ -79,10 +75,6 @@ void snd_tscm_proc_init(struct snd_tscm *tscm) if (root == NULL) return; root->mode = S_IFDIR | 0555; - if (snd_info_register(root) < 0) { - snd_info_free_entry(root); - return; - } add_node(tscm, root, "firmware", proc_read_firmware); } From patchwork Tue Feb 5 16:05:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 10797659 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 5F6DD186D for ; Tue, 5 Feb 2019 16:16:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B6692C668 for ; Tue, 5 Feb 2019 16:16:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3FC542C67B; Tue, 5 Feb 2019 16:16:22 +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 75A102C5BB for ; Tue, 5 Feb 2019 16:16:21 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 28E872675B6; Tue, 5 Feb 2019 17:05:41 +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 E79352674C5; Tue, 5 Feb 2019 17:05:36 +0100 (CET) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id BF0A1267488 for ; Tue, 5 Feb 2019 17:05:32 +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 EE3EFB67E; Tue, 5 Feb 2019 16:05:31 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Tue, 5 Feb 2019 17:05:26 +0100 Message-Id: <20190205160527.8815-3-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190205160527.8815-1-tiwai@suse.de> References: <20190205160527.8815-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 2/3] ALSA: opl4: Remove superfluous snd_info_register() calls 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 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. Signed-off-by: Takashi Iwai --- sound/drivers/opl4/opl4_proc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sound/drivers/opl4/opl4_proc.c b/sound/drivers/opl4/opl4_proc.c index 16b24091d799..f1b839a0e7b7 100644 --- a/sound/drivers/opl4/opl4_proc.c +++ b/sound/drivers/opl4/opl4_proc.c @@ -114,10 +114,6 @@ int snd_opl4_create_proc(struct snd_opl4 *opl4) entry->c.ops = &snd_opl4_mem_proc_ops; entry->module = THIS_MODULE; entry->private_data = opl4; - if (snd_info_register(entry) < 0) { - snd_info_free_entry(entry); - entry = NULL; - } } opl4->proc_entry = entry; return 0; From patchwork Tue Feb 5 16:05:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 10797665 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 47E6813BF for ; Tue, 5 Feb 2019 16:16:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 367E52BA78 for ; Tue, 5 Feb 2019 16:16:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B1AF2BBA8; Tue, 5 Feb 2019 16:16:23 +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 A38672C625 for ; Tue, 5 Feb 2019 16:16:21 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 445062674B6; Tue, 5 Feb 2019 17:05:37 +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 D6BBD26769E; Tue, 5 Feb 2019 17:05:34 +0100 (CET) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id C4CF32674C5 for ; Tue, 5 Feb 2019 17:05:32 +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 052ECB67F; Tue, 5 Feb 2019 16:05:32 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Tue, 5 Feb 2019 17:05:27 +0100 Message-Id: <20190205160527.8815-4-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190205160527.8815-1-tiwai@suse.de> References: <20190205160527.8815-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 3/3] ALSA: emux: Remove superfluous snd_info_register() calls 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 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. Signed-off-by: Takashi Iwai --- sound/synth/emux/emux_proc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sound/synth/emux/emux_proc.c b/sound/synth/emux/emux_proc.c index a82b4053bee8..c14781ac7941 100644 --- a/sound/synth/emux/emux_proc.c +++ b/sound/synth/emux/emux_proc.c @@ -115,10 +115,6 @@ void snd_emux_proc_init(struct snd_emux *emu, struct snd_card *card, int device) entry->content = SNDRV_INFO_CONTENT_TEXT; entry->private_data = emu; entry->c.text.read = snd_emux_proc_info_read; - if (snd_info_register(entry) < 0) - snd_info_free_entry(entry); - else - emu->proc = entry; } void snd_emux_proc_free(struct snd_emux *emu)