All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Van Asbroeck <thesven73@gmail.com>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>,
	Mark Brown <broonie@kernel.org>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>,
	Jyri Sarha <jsarha@ti.com>
Cc: alsa-devel@alsa-project.org,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	David Airlie <airlied@linux.ie>, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	dri-devel@lists.freedesktop.org, Daniel Vetter <daniel@ffwll.ch>
Subject: [RFC PATCH 2/2] ASoC: core: standardize snd_soc_dai_set_bclk_ratio() behaviour
Date: Mon, 25 Feb 2019 11:42:18 -0500	[thread overview]
Message-ID: <20190225164218.19439-2-TheSven73@gmail.com> (raw)
In-Reply-To: <20190225164218.19439-1-TheSven73@gmail.com>

snd_soc_dai_set_bclk_ratio() should behave like other
snd_soc_dai_XXX functions, and return -ENOTSUPP if the
callback in driver->ops is NULL.

Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
---
 sound/soc/soc-core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 50617db05c46..5611caf25ea3 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2550,10 +2550,11 @@ EXPORT_SYMBOL_GPL(snd_soc_component_set_pll);
  */
 int snd_soc_dai_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio)
 {
-	if (dai->driver->ops->set_bclk_ratio)
-		return dai->driver->ops->set_bclk_ratio(dai, ratio);
-	else
+	if (dai->driver == NULL)
 		return -EINVAL;
+	if (dai->driver->ops->set_bclk_ratio == NULL)
+		return -ENOTSUPP;
+	return dai->driver->ops->set_bclk_ratio(dai, ratio);
 }
 EXPORT_SYMBOL_GPL(snd_soc_dai_set_bclk_ratio);
 
-- 
2.17.1

  reply	other threads:[~2019-02-25 16:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-25 16:42 [RFC PATCH 1/2] ASoC: simple-card: add support for bclk_ratio Sven Van Asbroeck
2019-02-25 16:42 ` Sven Van Asbroeck [this message]
2019-02-26  0:35 ` Kuninori Morimoto
2019-02-26  9:11   ` Russell King - ARM Linux admin
2019-02-26 14:53     ` Sven Van Asbroeck
2019-02-26 15:23       ` Mark Brown
2019-02-26 15:45       ` Russell King - ARM Linux admin
2019-02-26 16:21         ` Mark Brown
2019-02-26 16:31         ` Sven Van Asbroeck
2019-02-26 16:41           ` Mark Brown
2019-02-26 17:03           ` Russell King - ARM Linux admin
2019-02-27 18:36             ` Mark Brown
2019-02-26 18:46     ` Sven Van Asbroeck

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=20190225164218.19439-2-TheSven73@gmail.com \
    --to=thesven73@gmail.com \
    --cc=airlied@linux.ie \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux@armlinux.org.uk \
    --cc=peter.ujfalusi@ti.com \
    --cc=tiwai@suse.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.