All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>,
	Simon <horms@verge.net.au>, Liam Girdwood <lgirdwood@gmail.com>
Subject: [PATCH 4/8] ASoC: simple-scu-card: tidyup asoc_simple_card_parse_links() method
Date: Thu, 25 Aug 2016 01:57:30 +0000	[thread overview]
Message-ID: <87h9a91uue.wl%kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87mvk11uxo.wl%kuninori.morimoto.gx@renesas.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Current asoc_simple_card_parse_links() is setting dai_link daifmt.
But, asoc_simple_card_parse_links() is doing it.
This patch clean-up this point less method

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/generic/simple-scu-card.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/sound/soc/generic/simple-scu-card.c b/sound/soc/generic/simple-scu-card.c
index 83add14..2f40f9c 100644
--- a/sound/soc/generic/simple-scu-card.c
+++ b/sound/soc/generic/simple-scu-card.c
@@ -110,6 +110,7 @@ static int asoc_simple_card_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
 
 static int asoc_simple_card_parse_links(struct device_node *np,
 					struct asoc_simple_card_priv *priv,
+					unsigned int daifmt,
 					int idx, bool is_fe)
 {
 	struct device *dev = simple_priv_to_dev(priv);
@@ -188,6 +189,7 @@ static int asoc_simple_card_parse_links(struct device_node *np,
 	if (ret < 0)
 		return ret;
 
+	dai_link->dai_fmt		= daifmt;
 	dai_link->dpcm_playback		= 1;
 	dai_link->dpcm_capture		= 1;
 	dai_link->ops			= &asoc_simple_card_ops;
@@ -205,7 +207,6 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
 				 struct asoc_simple_card_priv *priv)
 {
 	struct device *dev = simple_priv_to_dev(priv);
-	struct snd_soc_dai_link *dai_link;
 	struct device_node *np;
 	unsigned int daifmt = 0;
 	int ret, i;
@@ -223,14 +224,11 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
 
 	i = 0;
 	for_each_child_of_node(node, np) {
-		dai_link = simple_priv_to_link(priv, i);
-		dai_link->dai_fmt = daifmt;
-
 		is_fe = false;
 		if (strcmp(np->name, PREFIX "cpu") == 0)
 			is_fe = true;
 
-		ret = asoc_simple_card_parse_links(np, priv, i, is_fe);
+		ret = asoc_simple_card_parse_links(np, priv, daifmt, i, is_fe);
 		if (ret < 0)
 			return ret;
 		i++;
-- 
1.9.1

  parent reply	other threads:[~2016-08-25  1:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-25  1:55 [PATCH 0/8] ASoC: simple-scu-card: tidyup and synchronize patches Kuninori Morimoto
2016-08-25  1:56 ` [PATCH 1/8] ASoC: simple-scu-card: remove unused definitions Kuninori Morimoto
2016-08-25  1:56 ` [PATCH 2/8] ASoC: simple-scu-card: is GPL v2 Kuninori Morimoto
2016-08-25  1:57 ` [PATCH 3/8] ASoC: simple-scu-card: tidyup codec daifmt handling method Kuninori Morimoto
2016-08-25  1:57 ` Kuninori Morimoto [this message]
2016-08-25  1:57 ` [PATCH 5/8] ASoC: simple-scu-card: depends on CONFIG_OF Kuninori Morimoto
2016-08-25  1:58 ` [PATCH 6/8] ASoC: simple-scu-card: add 2 CPU 1 Codec example Kuninori Morimoto
2016-08-25  1:58 ` [PATCH 7/8] ASoC: simple-scu-card: code sync: move asoc_simple_card_of_match Kuninori Morimoto
2016-08-25  1:58 ` [PATCH 8/8] ASoC: simple-scu-card: code sync: tidyup TDM setting position Kuninori Morimoto

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=87h9a91uue.wl%kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=horms@verge.net.au \
    --cc=lgirdwood@gmail.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.