From patchwork Tue Aug 14 14:01:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Ziswiler X-Patchwork-Id: 10565649 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 169161390 for ; Tue, 14 Aug 2018 14:02:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 089A729DF1 for ; Tue, 14 Aug 2018 14:02:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F091A29E0E; Tue, 14 Aug 2018 14:02:25 +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 2559C29E07 for ; Tue, 14 Aug 2018 14:02:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E6A0426770B; Tue, 14 Aug 2018 16:02:22 +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 891F52677A8; Tue, 14 Aug 2018 16:02:19 +0200 (CEST) Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by alsa0.perex.cz (Postfix) with ESMTP id C05D82676B4 for ; Tue, 14 Aug 2018 16:02:16 +0200 (CEST) Received: from localhost.localdomain.toradex.int ([46.140.72.82]) by mrelay.perfora.net (mreueus001 [74.208.5.2]) with ESMTPA (Nemesis) id 0MMVI0-1fnxb0420s-008I1Z; Tue, 14 Aug 2018 16:01:57 +0200 From: Marcel Ziswiler To: alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org Date: Tue, 14 Aug 2018 16:01:44 +0200 Message-Id: <20180814140145.12212-1-marcel@ziswiler.com> X-Mailer: git-send-email 2.14.4 X-Provags-ID: V03:K1:Sayw6tQDNtlkZY1En5ZSgkELCTwmLGy/4JkqynxVNaiDeHAaB8Y f0JpTn84ty3WJzOjkf9FB2ku9G1gVuRTwZNY32HTtESWWAMZp+74ms7cjHwhjJRx6RY5Oqb YA9r3WhgVEMufMmxILEzh/5FMQ2Scasi/EPnjpif+TWaETPbnOApM5t7E7qGLRnaRJ6Kl8I Gr5UjLT6XfRxw1bNzEwgA== X-UI-Out-Filterresults: notjunk:1;V01:K0:e1lenST1Pc8=:f9S0bhjspiSZqPD317KrBg +OUu5NYXmb78Yz8gYx8vDh6ZCNzWCIMyujOgwxRwOgDk8KLvpVePWWqgqkMV7ouwgxD4y3G+n I0ofvdck/qG9lFDSgoV6mFQtT7mBep3UexNnfese4qCX4pz7K+5B0B85fVbXSCQqXxBHin2fK hgtdYIxUbtqBmfE2tgGcwveYe7S7CG75YJ/GA7oyOBVJyEaJ8iAud2OPzPo/1cfLW/D9LRk98 EPSJWVFbLhUG3DV1ry5NqgfBTLt7IyQgAuyJRE2cSp07OdQtGyb979p1NxgdVZyW+kE3R2CGM L/ONFFpBUzpEp1COhmGycLCF1CJKb4JMzyHHVDgMRKEBipMgFKfSm72clAXUnLUIR4QctqswE yRiNFNsXJyx1oSLQK0OYz0HTNuF/sGE+V6n+emIrSZKQs1o9tpgH8yleYLOmcD14HcOLUscy9 E/OSRYs5EJI4osRQioMoyOD2/euWCWoIonqTwjhpNhO7VPmphXzazd8Y91HAcZRIhVlcKAisu oImV0lF5/fVu35DuVfBIde8qd/rW4qpCsD/aMOrdGwbH6qdsiEBNRmH0twKOmY0rUlYmytx5x xxZDjqoMft2h64sg8JvPmLMucCCvTecwXrzpEBWHoHSiBojT3KJio7FpZx26Ix3Nm0fcQ77AY AH/dEumriqhF7IDbcKU1FGQwSxG3vfbb093VGnXS4xIvn6wEj3it5bVNX/3fhrQCHd6g= Cc: Liam Girdwood , Marcel Ziswiler , Takashi Iwai , linux-kernel@vger.kernel.org, Stefan Agner , Jonathan Hunter , Mark Brown , Thierry Reding Subject: [alsa-devel] [PATCH v2] ASoC: tegra: probe deferral error reporting 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 From: Marcel Ziswiler Actually report the error codes from of_get_named_gpio() resp. devm_gpio_request_one() upon trying to get the codec reset resp. sync GPIOs unless it is just a probe deferral. Signed-off-by: Marcel Ziswiler Acked-by: Jon Hunter Reviewed-by: Stefan Agner --- Changes in v2: - Silence probe deferral as suggested by Stefan. - Fix line over 80 characters as reported by checkpatch. sound/soc/tegra/tegra20_ac97.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/sound/soc/tegra/tegra20_ac97.c b/sound/soc/tegra/tegra20_ac97.c index 682ef33afb5f..2ac6b2d73980 100644 --- a/sound/soc/tegra/tegra20_ac97.c +++ b/sound/soc/tegra/tegra20_ac97.c @@ -351,18 +351,31 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev) ret = devm_gpio_request_one(&pdev->dev, ac97->reset_gpio, GPIOF_OUT_INIT_HIGH, "codec-reset"); if (ret) { - dev_err(&pdev->dev, "could not get codec-reset GPIO\n"); + if (ret != -EPROBE_DEFER) + dev_err(&pdev->dev, + "could not get codec-reset GPIO: %d\n", + ret); + goto err_clk_put; } } else { - dev_err(&pdev->dev, "no codec-reset GPIO supplied\n"); + ret = ac97->reset_gpio; + if (ret != -EPROBE_DEFER) + dev_err(&pdev->dev, + "no codec-reset GPIO supplied: %d\n", + ret); + goto err_clk_put; } ac97->sync_gpio = of_get_named_gpio(pdev->dev.of_node, "nvidia,codec-sync-gpio", 0); if (!gpio_is_valid(ac97->sync_gpio)) { - dev_err(&pdev->dev, "no codec-sync GPIO supplied\n"); + ret = ac97->sync_gpio; + if (ret != -EPROBE_DEFER) + dev_err(&pdev->dev, "no codec-sync GPIO supplied: %d\n", + ret); + goto err_clk_put; }