devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sameer Pujar <spujar@nvidia.com>
To: <broonie@kernel.org>, <robh@kernel.org>
Cc: <jonathanh@nvidia.com>, <kuninori.morimoto.gx@renesas.com>,
	<alsa-devel@alsa-project.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, Sameer Pujar <spujar@nvidia.com>
Subject: [RFC PATCH 1/5] ASoC: soc-component: Fix return value of snd_soc_component_set_pll()
Date: Thu, 25 Feb 2021 23:36:00 +0530	[thread overview]
Message-ID: <1614276364-13655-2-git-send-email-spujar@nvidia.com> (raw)
In-Reply-To: <1614276364-13655-1-git-send-email-spujar@nvidia.com>

snd_soc_component_set_pll() returns "-EINVAL" and prints following
error if a component does not implement set_pll() callback exposed
by the component driver. This happens when snd_soc_dai_set_sysclk()
is invoked, which in turn calls snd_soc_component_set_pll().

  "ASoC: error at snd_soc_dai_set_pll on xxx: -22"

Above is not necessary because a component may not need additional
configuration and chooses to not implement this.

Fix this by changing default return value to "-ENOTSUPP" and driver
code which invokes snd_soc_component_set_pll() can ignore this error.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
---
 sound/soc/soc-component.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c
index 159bf88..fd04e75 100644
--- a/sound/soc/soc-component.c
+++ b/sound/soc/soc-component.c
@@ -109,7 +109,7 @@ int snd_soc_component_set_pll(struct snd_soc_component *component, int pll_id,
 			      int source, unsigned int freq_in,
 			      unsigned int freq_out)
 {
-	int ret = -EINVAL;
+	int ret = -ENOTSUPP;
 
 	if (component->driver->set_pll)
 		ret = component->driver->set_pll(component, pll_id, source,
-- 
2.7.4


  reply	other threads:[~2021-02-25 18:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-25 18:05 [RFC PATCH 0/5] Flexible sysclk/pll configuration Sameer Pujar
2021-02-25 18:06 ` Sameer Pujar [this message]
2021-02-25 18:06 ` [RFC PATCH 2/5] ASoC: soc-dai: Add sysclk source to snd_soc_dai_set_sysclk() Sameer Pujar
2021-02-25 18:06 ` [RFC PATCH 3/5] ASoC: audio-graph-card: Add bindings for sysclk and pll Sameer Pujar
2021-03-02  2:10   ` Rob Herring
2021-03-02  7:03     ` Sameer Pujar
2021-03-02 16:12       ` Mark Brown
2021-02-25 18:06 ` [RFC PATCH 4/5] ASoC: simple-card-utils: Parse sysclk id and source Sameer Pujar
2021-02-25 18:06 ` [RFC PATCH 5/5] ASoC: simple-card-utils: Support pll configuration Sameer Pujar
2021-02-26  5:24 ` [RFC PATCH 0/5] Flexible sysclk/pll configuration Sameer Pujar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1614276364-13655-2-git-send-email-spujar@nvidia.com \
    --to=spujar@nvidia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).