From patchwork Wed Oct 19 17:21:06 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: 9385085 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 4007960762 for ; Wed, 19 Oct 2016 17:58:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3516229262 for ; Wed, 19 Oct 2016 17:58:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29B4729276; Wed, 19 Oct 2016 17:58:36 +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 F16B029262 for ; Wed, 19 Oct 2016 17:58:34 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 578DF266FD4; Wed, 19 Oct 2016 19:58:33 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 51B6B266FC0; Wed, 19 Oct 2016 19:56:08 +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 65DA3266E0F; 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 26526266DDE for ; Wed, 19 Oct 2016 19:21:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by s-opensource.com (Postfix) with ESMTP id C94F0A0E61; Wed, 19 Oct 2016 17:21:33 +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 wRenPsw7SxuK; Wed, 19 Oct 2016 17:21:33 +0000 (UTC) Received: from minerva.sisa.samsung.com (unknown [181.121.136.80]) by s-opensource.com (Postfix) with ESMTPSA id C2875A0DFA; Wed, 19 Oct 2016 17:21:29 +0000 (UTC) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Date: Wed, 19 Oct 2016 14:21:06 -0300 Message-Id: <1476897666-13974-3-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, Sangbeom Kim , Takashi Iwai , Liam Girdwood , Krzysztof Kozlowski , Javier Martinez Canillas , Mark Brown , Sylwester Nawrocki Subject: [alsa-devel] [RFC PATCH 2/2] ASoC: samsung: Print a one-time message if the snow driver's probe defers 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 the snd_soc_register_card() fails due a missing resource and the probe has to be deferred, the driver prints an error message. 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/samsung/snow.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/samsung/snow.c b/sound/soc/samsung/snow.c index d8ac907bbb0d..068bfb78a668 100644 --- a/sound/soc/samsung/snow.c +++ b/sound/soc/samsung/snow.c @@ -103,7 +103,13 @@ static int snow_probe(struct platform_device *pdev) ret = devm_snd_soc_register_card(&pdev->dev, card); if (ret) { - dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); + if (ret == -EPROBE_DEFER) + dev_err_once(&pdev->dev, + "snd_soc_register_card deferred (%d)\n", + ret); + else + dev_err(&pdev->dev, + "snd_soc_register_card failed (%d)\n", ret); return ret; }