diff mbox

[2/4,v2] ASoC: simple-card: remove dai_link->cpu_dai_name when DT

Message ID 8738chia5n.wl%kuninori.morimoto.gx@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kuninori Morimoto Aug. 28, 2014, 3:08 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

f687d900d30a61dda38db2a99239f5284a86a309
(ASoC: simple-card: cpu_dai_name creates confusion when DT case)
removed dai_link->cpu_dai_name when DT case,
since it uses DT phand in soc_bind_dai_link().
This binding will fail if it has cpu_dai_name.

6a91a17bd7b92b2d2aa9ece85457f52a62fd7708
(ASoC: simple-card: Handle many DAI links)
added multi DAI link support to simple-card driver.
Then, removing cpu_dai_name was cared only single DAI.
But, it is needed in all DT cases.
This patch moves it to asoc_simple_card_dai_link_of()
so that care about all DAIs.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

 - no change

 sound/soc/generic/simple-card.c |   23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

Comments

Mark Brown Aug. 29, 2014, 11:51 a.m. UTC | #1
On Wed, Aug 27, 2014 at 08:08:06PM -0700, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> f687d900d30a61dda38db2a99239f5284a86a309
> (ASoC: simple-card: cpu_dai_name creates confusion when DT case)
> removed dai_link->cpu_dai_name when DT case,
> since it uses DT phand in soc_bind_dai_link().
> This binding will fail if it has cpu_dai_name.

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index c5445b0..e8185a0 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -285,6 +285,17 @@  static int asoc_simple_card_dai_link_of(struct device_node *node,
 		dai_props->codec_dai.fmt,
 		dai_props->codec_dai.sysclk);
 
+	/*
+	 * soc_bind_dai_link() will check cpu name
+	 * after of_node matching if dai_link has cpu_dai_name.
+	 * but, it will never match if name was created by fmt_single_name()
+	 * remove cpu_dai_name to escape name matching.
+	 * see
+	 *	fmt_single_name()
+	 *	fmt_multiple_name()
+	 */
+	dai_link->cpu_dai_name = NULL;
+
 dai_link_of_err:
 	if (np)
 		of_node_put(np);
@@ -429,18 +440,6 @@  static int asoc_simple_card_probe(struct platform_device *pdev)
 			goto err;
 		}
 
-		/*
-		 * soc_bind_dai_link() will check cpu name
-		 * after of_node matching if dai_link has cpu_dai_name.
-		 * but, it will never match if name was created by fmt_single_name()
-		 * remove cpu_dai_name to escape name matching.
-		 * see
-		 *	fmt_single_name()
-		 *	fmt_multiple_name()
-		 */
-		if (num_links == 1)
-			dai_link->cpu_dai_name = NULL;
-
 	} else {
 		struct asoc_simple_card_info *cinfo;