From patchwork Tue May 5 12:56:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 6337951 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DD741BEEE1 for ; Tue, 5 May 2015 12:57:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 03EAC202EB for ; Tue, 5 May 2015 12:57:54 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id CDD3520266 for ; Tue, 5 May 2015 12:57:52 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id AB8F1265626; Tue, 5 May 2015 14:57:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 8F30926536C; Tue, 5 May 2015 14:56:58 +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 B3810265363; Tue, 5 May 2015 14:56:56 +0200 (CEST) Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by alsa0.perex.cz (Postfix) with ESMTP id 18B72265274 for ; Tue, 5 May 2015 14:56:38 +0200 (CEST) Received: by pabsx10 with SMTP id sx10so192336677pab.3 for ; Tue, 05 May 2015 05:56:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nQHt29MehTfqu7bekDn9AHCCVylbY6VjxUcsH66NrWk=; b=OAJkoOnUD31TBu0Yb/i9I8PQegRBZmcIW/4RG72VzytW7tzjKMgGCaddytRblg52lZ DRajza/9oeBFfHdKOE2bWgtF83q0JXaUD7BiIKg0zdPa5lsvgk6RY6TB0w46GjAlr+Gx Ws7DzIXeYqlu7uscxTNng3JH+h+QuNs/20kErYdJFdbj3XODMjrLEiYrnD2c17iXxD8w wUiT7R+E6P6rVZX6LcMCHUIz0J7u03+Mft1RtNU/Ca5OsmA8p6pDXW32anUv/O4nrNdT CMOEMM0DzyBBrKPXjQUTSwjn+NNxYT9nFmSOlfRr0oKhI5Y0szO32i8kH1U63of0204F hRyw== X-Received: by 10.68.213.135 with SMTP id ns7mr32826856pbc.157.1430830597302; Tue, 05 May 2015 05:56:37 -0700 (PDT) Received: from localhost ([216.228.120.20]) by mx.google.com with ESMTPSA id ef3sm15847174pbc.26.2015.05.05.05.56.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 May 2015 05:56:36 -0700 (PDT) From: Thierry Reding To: Takashi Iwai Date: Tue, 5 May 2015 14:56:21 +0200 Message-Id: <1430830584-3113-3-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1430830584-3113-1-git-send-email-thierry.reding@gmail.com> References: <1430830584-3113-1-git-send-email-thierry.reding@gmail.com> Cc: linux-tegra@vger.kernel.org, Alexandre Courbot , Dylan Reid , alsa-devel@alsa-project.org, Stephen Warren Subject: [alsa-devel] [PATCH 3/6] ALSA: hda/tegra - Improve 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: Thierry Reding When probing, provide accurate error messages to help with debugging failures. Signed-off-by: Thierry Reding --- sound/pci/hda/hda_tegra.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c index 7003677f7473..477742cb70a2 100644 --- a/sound/pci/hda/hda_tegra.c +++ b/sound/pci/hda/hda_tegra.c @@ -316,14 +316,20 @@ static int hda_tegra_init_chip(struct azx *chip, struct platform_device *pdev) int err; hda->hda_clk = devm_clk_get(dev, "hda"); - if (IS_ERR(hda->hda_clk)) + if (IS_ERR(hda->hda_clk)) { + dev_err(dev, "failed to get hda clock\n"); return PTR_ERR(hda->hda_clk); + } hda->hda2codec_2x_clk = devm_clk_get(dev, "hda2codec_2x"); - if (IS_ERR(hda->hda2codec_2x_clk)) + if (IS_ERR(hda->hda2codec_2x_clk)) { + dev_err(dev, "failed to get hda2codec_2x clock\n"); return PTR_ERR(hda->hda2codec_2x_clk); + } hda->hda2hdmi_clk = devm_clk_get(dev, "hda2hdmi"); - if (IS_ERR(hda->hda2hdmi_clk)) + if (IS_ERR(hda->hda2hdmi_clk)) { + dev_err(dev, "failed to get hda2hdmi clock\n"); return PTR_ERR(hda->hda2hdmi_clk); + } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hda->regs = devm_ioremap_resource(dev, res); @@ -334,8 +340,10 @@ static int hda_tegra_init_chip(struct azx *chip, struct platform_device *pdev) bus->addr = res->start + HDA_BAR0; err = hda_tegra_enable_clocks(hda); - if (err) + if (err) { + dev_err(dev, "failed to get enable clocks\n"); return err; + } hda_tegra_init(hda); @@ -385,12 +393,17 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev) /* initialize streams */ err = azx_init_streams(chip); - if (err < 0) + if (err < 0) { + dev_err(card->dev, "failed to initialize streams: %d\n", err); return err; + } err = azx_alloc_stream_pages(chip); - if (err < 0) + if (err < 0) { + dev_err(card->dev, "failed to allocate stream pages: %d\n", + err); return err; + } /* initialize chip */ azx_init_chip(chip, 1);