From patchwork Thu Sep 5 04:03:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 173117 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp194812ilq; Wed, 4 Sep 2019 21:03:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6O4DZ3Eookf8ue8ybxY0pnmu/8H0MeSu+Wlm7n+aXrBUHqnBuKyK3v3mu0GNjcJAdaW8+ X-Received: by 2002:a17:90a:ca02:: with SMTP id x2mr1583619pjt.98.1567656192253; Wed, 04 Sep 2019 21:03:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567656192; cv=none; d=google.com; s=arc-20160816; b=XexqWaUwvhB446/dn+HOrmgUubVZZudOU4ohhB7LbFZNfOjif6P6R+LbiDKZ921bKE eDAjpkQahH7GnbEQyT/vh8rfvejFvBuX8e7P356s5gg/pWr9zAGIf/uUA/RKu+70Wdqu Sb/wHBhlh7ZezgX5ibdhrDuY0wQk9oEJk/sshoOxpkD9GaPxQYO71h+YmnclVWRiX+lr NRPanm8kUZouC/BOc4sdpuyA5v6naZCu2IsZK8VileF3cRXWQ7+J4gA/+taLT2QMsSva KVHLK/OyfOysIiuzNdgBdOWvrBWxTC/NDCntq4VqpSRHKlT3vP6miZopjlQZAiZF073B kDbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=gzTkO0Rbhbc6qGDT4uIsvz+/20vaG5J88mBFRCtZ1I0=; b=r1aQH9RQqVUei8COvh1tqv5tuY1Dy3UabvRc17Ha1ThQm5UPpg1rBVMamyWDQc2Aoq vGEA2/GjR94US3/67a9oIdUMOcZb5XYNGu+J0BhhmoOTfpK2lEKNrGISm1rAF2X3NvP/ kLr+FBOozxuNE/57EMFt0L+WhhZiDIzZvNJXlwq963FNyQaPffGPPf6xK+Kz7eKKR78q f/ai95XslV/dIVPM68EJvUQJfHOUrRYl71lZ9h/cxAOrbvbulg0muzIAoUH/7D5jxBDZ +qqY0WY8LSIejNaSRc/zFpFi57lsLbIrTZK+msuwagsbZ/Nhbz5JGaxLm49Omnkbv+W4 D7tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UlWHaWw3; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s23si817615plp.360.2019.09.04.21.03.11; Wed, 04 Sep 2019 21:03:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UlWHaWw3; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726088AbfIEEDL (ORCPT + 16 others); Thu, 5 Sep 2019 00:03:11 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:40458 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726073AbfIEEDK (ORCPT ); Thu, 5 Sep 2019 00:03:10 -0400 Received: by mail-pg1-f196.google.com with SMTP id w10so620454pgj.7 for ; Wed, 04 Sep 2019 21:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=gzTkO0Rbhbc6qGDT4uIsvz+/20vaG5J88mBFRCtZ1I0=; b=UlWHaWw3ysvzZNAgX+b35OI9+m0ei8mMYZmwfZkhVK967RNE5uj2MIBkIHRATZ5esw qb2hPWTAVy6dFfKt9um30IWo4TxlIZ53AIWY/28YO0JO4StEDkqmHg80vf+RH6jcQLEz ZWb0ozANSR8EuLNR2PzNS6phOTLdfV9S/Q/P/YNrtoXg45wfaFcNPw+0BI/TIMwWp3WN kbyD3hUtDym4qEsogP3jw/HeyECxPiimveggDTcLyrotnFzwHZ7I9jVvypxJyOSQsYAS vX2rANBi1fBc+TFWVqqG5PhXk53W73VDFlESbnWLTqIV3+vpAm33Y01DXzE4l1o+yOkh G2Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gzTkO0Rbhbc6qGDT4uIsvz+/20vaG5J88mBFRCtZ1I0=; b=rs+oyKfIDUKPYC8pPyjVNecGdvOsAE553fJmRszPcaBEowmw3TlI/LxaFudf7gA+Dw oVIW+owtxlAQ3EVFxNpcBZMYjY+d0PBFIj/+qlUsMV1vMtyENsUpBV57E2R+v9ZruSpc lhg78wi84MsFjv1BxJuhy9P+7kktEb54Tc0CqL6luSFhv+n5R1Zwi5aPIps+EPmWXZVk Myle2ouIs4kzNo8oWfz7ys7uwFyLZkLPWqEepE9JCW3wgx3wYxCLzs48zvKWHvGzaGgy EsrIgi1BsG/eFVPXYoD2UPSrmS90IjqD4KSAWnXqEnXhbT0BeEyk0I2K+jcUL5roySYP 8rUg== X-Gm-Message-State: APjAAAX3PQCC8jGPzQg0mXwjesNXPJJQgHknpAe1CKppgpIYzB8PMh6/ QpG3KIZZoVIJXmeOh5R5bXKT7NynfFo= X-Received: by 2002:aa7:8a13:: with SMTP id m19mr1324958pfa.228.1567656190065; Wed, 04 Sep 2019 21:03:10 -0700 (PDT) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id u9sm498058pjb.4.2019.09.04.21.03.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Sep 2019 21:03:09 -0700 (PDT) From: Bjorn Andersson To: Patrick Lai , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH] ASoC: qcom: common: Include link-name in error messages Date: Wed, 4 Sep 2019 21:03:06 -0700 Message-Id: <20190905040306.21399-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Reading out the link-name earlier and including it in the various error messages makes it much more convenient to figure out what links have unmet dependencies. Signed-off-by: Bjorn Andersson --- sound/soc/qcom/common.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) -- 2.18.0 diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c index 2c7348ddbbb3..6c20bdd850f3 100644 --- a/sound/soc/qcom/common.c +++ b/sound/soc/qcom/common.c @@ -53,12 +53,18 @@ int qcom_snd_parse_of(struct snd_soc_card *card) link->num_cpus = 1; link->num_platforms = 1; + ret = of_property_read_string(np, "link-name", &link->name); + if (ret) { + dev_err(card->dev, "error getting codec dai_link name\n"); + goto err; + } + cpu = of_get_child_by_name(np, "cpu"); platform = of_get_child_by_name(np, "platform"); codec = of_get_child_by_name(np, "codec"); if (!cpu) { - dev_err(dev, "Can't find cpu DT node\n"); + dev_err(dev, "%s: Can't find cpu DT node\n", link->name); ret = -EINVAL; goto err; } @@ -66,7 +72,7 @@ int qcom_snd_parse_of(struct snd_soc_card *card) ret = of_parse_phandle_with_args(cpu, "sound-dai", "#sound-dai-cells", 0, &args); if (ret) { - dev_err(card->dev, "error getting cpu phandle\n"); + dev_err(card->dev, "%s: error getting cpu phandle\n", link->name); goto err; } link->cpus->of_node = args.np; @@ -74,7 +80,7 @@ int qcom_snd_parse_of(struct snd_soc_card *card) ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name); if (ret) { - dev_err(card->dev, "error getting cpu dai name\n"); + dev_err(card->dev, "%s: error getting cpu dai name\n", link->name); goto err; } @@ -83,14 +89,14 @@ int qcom_snd_parse_of(struct snd_soc_card *card) "sound-dai", 0); if (!link->platforms->of_node) { - dev_err(card->dev, "platform dai not found\n"); + dev_err(card->dev, "%s: platform dai not found\n", link->name); ret = -EINVAL; goto err; } ret = snd_soc_of_get_dai_link_codecs(dev, codec, link); if (ret < 0) { - dev_err(card->dev, "codec dai not found\n"); + dev_err(card->dev, "%s: codec dai not found\n", link->name); goto err; } link->no_pcm = 1; @@ -110,12 +116,6 @@ int qcom_snd_parse_of(struct snd_soc_card *card) } link->ignore_suspend = 1; - ret = of_property_read_string(np, "link-name", &link->name); - if (ret) { - dev_err(card->dev, "error getting codec dai_link name\n"); - goto err; - } - link->nonatomic = 1; link->dpcm_playback = 1; link->dpcm_capture = 1;