diff mbox

ASoC: rsnd: fixup pcm_new callback method

Message ID 87bns6uiia.wl%kuninori.morimoto.gx@gmail.com (mailing list archive)
State Accepted
Commit 7c63f3c02f5a998621758239abed43c5bd454b70
Headers show

Commit Message

Kuninori Morimoto July 31, 2014, 6:53 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

bff58ea4f43d9b4a9fd6fb05fabc8f50f68131f5
(ASoC: rsnd: add DVC support) added DVC support,
and it added pcm_new callback feature for it.
Then it called all DAI's pcm_new callback, and it was wrong.
This patch fixup it and call correct callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/sh/rcar/core.c |   20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

Comments

Mark Brown July 31, 2014, 7:37 p.m. UTC | #1
On Wed, Jul 30, 2014 at 11:53:03PM -0700, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> bff58ea4f43d9b4a9fd6fb05fabc8f50f68131f5
> (ASoC: rsnd: add DVC support) added DVC support,
> and it added pcm_new callback feature for it.
> Then it called all DAI's pcm_new callback, and it was wrong.
> This patch fixup it and call correct callback.

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index f07742f..d7c6697 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -944,19 +944,17 @@  static struct snd_pcm_ops rsnd_pcm_ops = {
 
 static int rsnd_pcm_new(struct snd_soc_pcm_runtime *rtd)
 {
-	struct rsnd_priv *priv = snd_soc_dai_get_drvdata(rtd->cpu_dai);
-	struct rsnd_dai *rdai;
-	int i, ret;
+	struct snd_soc_dai *dai = rtd->cpu_dai;
+	struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
+	int ret;
 
-	for_each_rsnd_dai(rdai, priv, i) {
-		ret = rsnd_dai_call(pcm_new, &rdai->playback, rdai, rtd);
-		if (ret)
-			return ret;
+	ret = rsnd_dai_call(pcm_new, &rdai->playback, rdai, rtd);
+	if (ret)
+		return ret;
 
-		ret = rsnd_dai_call(pcm_new, &rdai->capture, rdai, rtd);
-		if (ret)
-			return ret;
-	}
+	ret = rsnd_dai_call(pcm_new, &rdai->capture, rdai, rtd);
+	if (ret)
+		return ret;
 
 	return snd_pcm_lib_preallocate_pages_for_all(
 		rtd->pcm,