From patchwork Wed Oct 19 17:21:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 9384967 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1987160487 for ; Wed, 19 Oct 2016 17:41:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DABD28B11 for ; Wed, 19 Oct 2016 17:41:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 025CB28CAD; Wed, 19 Oct 2016 17:41:12 +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=-1.9 required=2.0 tests=BAYES_00, 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 CD86628B11 for ; Wed, 19 Oct 2016 17:41:11 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4C3D0266FC0; Wed, 19 Oct 2016 19:41:10 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 620EF266DDE; Wed, 19 Oct 2016 19:38:53 +0200 (CEST) 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 58082266DF0; Wed, 19 Oct 2016 19:21:33 +0200 (CEST) Received: from s-opensource.com (ec2-52-27-115-49.us-west-2.compute.amazonaws.com [52.27.115.49]) by alsa0.perex.cz (Postfix) with ESMTP id 5165F266DF0 for ; Wed, 19 Oct 2016 19:21:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by s-opensource.com (Postfix) with ESMTP id DF76FA0E7C; Wed, 19 Oct 2016 17:21:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osg.samsung.com Received: from s-opensource.com ([127.0.0.1]) by localhost (s-opensource.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GG1fQC-nhayS; Wed, 19 Oct 2016 17:21:29 +0000 (UTC) Received: from minerva.sisa.samsung.com (unknown [181.121.136.80]) by s-opensource.com (Postfix) with ESMTPSA id 9663EA0E61; Wed, 19 Oct 2016 17:21:26 +0000 (UTC) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Date: Wed, 19 Oct 2016 14:21:05 -0300 Message-Id: <1476897666-13974-2-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476897666-13974-1-git-send-email-javier@osg.samsung.com> References: <1476897666-13974-1-git-send-email-javier@osg.samsung.com> Cc: alsa-devel@alsa-project.org, Liam Girdwood , Takashi Iwai , Javier Martinez Canillas , Mark Brown Subject: [alsa-devel] [RFC PATCH 1/2] ASoC: core: Print one-time messages if missing resources when binding DAIs 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 If snd_soc_find_dai() doesn't find a DAI in soc_bind_dai_link(), a error message is printed and an -EPROBE_DEFER errno code returned to the caller. But since many probe retries can happen before a resource is available, the printed messages can spam the kernel log buffer and slow the boot. The information is useful to know that a dependency was not meet and a defer happened, but isn't necessary to print it on each probe deferral. Signed-off-by: Javier Martinez Canillas --- sound/soc/soc-core.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index c0bbcd903261..4679c07e0ff6 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1013,8 +1013,8 @@ static int soc_bind_dai_link(struct snd_soc_card *card, cpu_dai_component.dai_name = dai_link->cpu_dai_name; rtd->cpu_dai = snd_soc_find_dai(&cpu_dai_component); if (!rtd->cpu_dai) { - dev_err(card->dev, "ASoC: CPU DAI %s not registered\n", - dai_link->cpu_dai_name); + dev_err_once(card->dev, "ASoC: CPU DAI %s not registered\n", + dai_link->cpu_dai_name); goto _err_defer; } @@ -1025,8 +1025,9 @@ static int soc_bind_dai_link(struct snd_soc_card *card, for (i = 0; i < rtd->num_codecs; i++) { codec_dais[i] = snd_soc_find_dai(&codecs[i]); if (!codec_dais[i]) { - dev_err(card->dev, "ASoC: CODEC DAI %s not registered\n", - codecs[i].dai_name); + dev_err_once(card->dev, + "ASoC: CODEC DAI %s not registered\n", + codecs[i].dai_name); goto _err_defer; } } @@ -1054,8 +1055,8 @@ static int soc_bind_dai_link(struct snd_soc_card *card, rtd->platform = platform; } if (!rtd->platform) { - dev_err(card->dev, "ASoC: platform %s not registered\n", - dai_link->platform_name); + dev_err_once(card->dev, "ASoC: platform %s not registered\n", + dai_link->platform_name); goto _err_defer; }