All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org
Subject: Applied "ASoC: rsnd: remove platform boot support from ctu.c" to the asoc tree
Date: Wed, 18 Nov 2015 18:09:38 +0000	[thread overview]
Message-ID: <E1Zz7Ao-0000HF-Be@debutante> (raw)
In-Reply-To: <87y4e6jvdf.wl%kuninori.morimoto.gx@renesas.com>

The patch

   ASoC: rsnd: remove platform boot support from ctu.c

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From cfe7c0390ac24c30bf8c79a6a05e637db56e3090 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Tue, 10 Nov 2015 05:12:13 +0000
Subject: [PATCH] ASoC: rsnd: remove platform boot support from ctu.c

No board is using Renesas sound driver via platform boot now.
This means all user is using DT boot. Platform boot support is
no longer needed. But, it strongly depends on platform boot style.
This patch removes platform boot support from ctu.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sh/rcar/ctu.c | 85 +++++++++++++++++++------------------------------
 1 file changed, 32 insertions(+), 53 deletions(-)

diff --git a/sound/soc/sh/rcar/ctu.c b/sound/soc/sh/rcar/ctu.c
index daa1017c8890..9506db4958bc 100644
--- a/sound/soc/sh/rcar/ctu.c
+++ b/sound/soc/sh/rcar/ctu.c
@@ -13,7 +13,6 @@
 #define CTU_NAME "ctu"
 
 struct rsnd_ctu {
-	struct rsnd_ctu_platform_info *info; /* rcar_snd.h */
 	struct rsnd_mod mod;
 };
 
@@ -24,6 +23,7 @@ struct rsnd_ctu {
 		     ((pos) = (struct rsnd_ctu *)(priv)->ctu + i);	\
 	     i++)
 
+#define rsnd_ctu_get(priv, id) ((struct rsnd_ctu *)(priv->ctu) + id)
 #define rsnd_ctu_initialize_lock(mod)	__rsnd_ctu_initialize_lock(mod, 1)
 #define rsnd_ctu_initialize_unlock(mod)	__rsnd_ctu_initialize_lock(mod, 0)
 static void __rsnd_ctu_initialize_lock(struct rsnd_mod *mod, u32 enable)
@@ -74,51 +74,15 @@ struct rsnd_mod *rsnd_ctu_mod_get(struct rsnd_priv *priv, int id)
 	if (WARN_ON(id < 0 || id >= rsnd_ctu_nr(priv)))
 		id = 0;
 
-	return rsnd_mod_get((struct rsnd_ctu *)(priv->ctu) + id);
-}
-
-static void rsnd_of_parse_ctu(struct platform_device *pdev,
-		       const struct rsnd_of_data *of_data,
-		       struct rsnd_priv *priv)
-{
-	struct device_node *node;
-	struct rsnd_ctu_platform_info *ctu_info;
-	struct rcar_snd_info *info = rsnd_priv_to_info(priv);
-	struct device *dev = &pdev->dev;
-	int nr;
-
-	if (!of_data)
-		return;
-
-	node = rsnd_ctu_of_node(priv);
-	if (!node)
-		return;
-
-	nr = of_get_child_count(node);
-	if (!nr)
-		goto rsnd_of_parse_ctu_end;
-
-	ctu_info = devm_kzalloc(dev,
-				sizeof(struct rsnd_ctu_platform_info) * nr,
-				GFP_KERNEL);
-	if (!ctu_info) {
-		dev_err(dev, "ctu info allocation error\n");
-		goto rsnd_of_parse_ctu_end;
-	}
-
-	info->ctu_info		= ctu_info;
-	info->ctu_info_nr	= nr;
-
-rsnd_of_parse_ctu_end:
-	of_node_put(node);
-
+	return rsnd_mod_get(rsnd_ctu_get(priv, id));
 }
 
 int rsnd_ctu_probe(struct platform_device *pdev,
 		   const struct rsnd_of_data *of_data,
 		   struct rsnd_priv *priv)
 {
-	struct rcar_snd_info *info = rsnd_priv_to_info(priv);
+	struct device_node *node;
+	struct device_node *np;
 	struct device *dev = rsnd_priv_to_dev(priv);
 	struct rsnd_ctu *ctu;
 	struct clk *clk;
@@ -129,20 +93,29 @@ int rsnd_ctu_probe(struct platform_device *pdev,
 	if (rsnd_is_gen1(priv))
 		return 0;
 
-	rsnd_of_parse_ctu(pdev, of_data, priv);
+	node = rsnd_ctu_of_node(priv);
+	if (!node)
+		return 0; /* not used is not error */
 
-	nr = info->ctu_info_nr;
-	if (!nr)
-		return 0;
+	nr = of_get_child_count(node);
+	if (!nr) {
+		ret = -EINVAL;
+		goto rsnd_ctu_probe_done;
+	}
 
 	ctu = devm_kzalloc(dev, sizeof(*ctu) * nr, GFP_KERNEL);
-	if (!ctu)
-		return -ENOMEM;
+	if (!ctu) {
+		ret = -ENOMEM;
+		goto rsnd_ctu_probe_done;
+	}
 
 	priv->ctu_nr	= nr;
 	priv->ctu	= ctu;
 
-	for_each_rsnd_ctu(ctu, priv, i) {
+	i = 0;
+	for_each_child_of_node(node, np) {
+		ctu = rsnd_ctu_get(priv, i);
+
 		/*
 		 * CTU00, CTU01, CTU02, CTU03 => CTU0
 		 * CTU10, CTU11, CTU12, CTU13 => CTU1
@@ -151,18 +124,24 @@ int rsnd_ctu_probe(struct platform_device *pdev,
 			 CTU_NAME, i / 4);
 
 		clk = devm_clk_get(dev, name);
-		if (IS_ERR(clk))
-			return PTR_ERR(clk);
-
-		ctu->info = &info->ctu_info[i];
+		if (IS_ERR(clk)) {
+			ret = PTR_ERR(clk);
+			goto rsnd_ctu_probe_done;
+		}
 
 		ret = rsnd_mod_init(priv, rsnd_mod_get(ctu), &rsnd_ctu_ops,
 				    clk, RSND_MOD_CTU, i);
 		if (ret)
-			return ret;
+			goto rsnd_ctu_probe_done;
+
+		i++;
 	}
 
-	return 0;
+
+rsnd_ctu_probe_done:
+	of_node_put(node);
+
+	return ret;
 }
 
 void rsnd_ctu_remove(struct platform_device *pdev,
-- 
2.6.2

  reply	other threads:[~2015-11-18 18:09 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10  5:08 [PATCH 0/13] ASoC: rsnd: remove SRC Gen1 and platform boot support Kuninori Morimoto
2015-11-10  5:09 ` [PATCH 01/13] ASoC: rsnd: remove Gen1 support from SRC Kuninori Morimoto
2015-11-18 18:09   ` Applied "ASoC: rsnd: remove Gen1 support from SRC" to the asoc tree Mark Brown
2015-11-10  5:10 ` [PATCH 03/13] ASoC: rsnd: SRC settings matches to datasheet Kuninori Morimoto
2015-11-18 18:09   ` Applied "ASoC: rsnd: SRC settings matches to datasheet" to the asoc tree Mark Brown
2015-11-10  5:11 ` [PATCH 04/13] ASoC: rsnd: remove platform boot support from core.c Kuninori Morimoto
2015-11-18 18:09   ` Applied "ASoC: rsnd: remove platform boot support from core.c" to the asoc tree Mark Brown
2015-11-10  5:11 ` [PATCH 05/13] ASoC: rsnd: remove platform boot support from ssi.c Kuninori Morimoto
2015-11-18 18:09   ` Applied "ASoC: rsnd: remove platform boot support from ssi.c" to the asoc tree Mark Brown
2015-11-10  5:11 ` [PATCH 06/13] ASoC: rsnd: remove platform boot support from src.c Kuninori Morimoto
2015-11-18 18:09   ` Applied "ASoC: rsnd: remove platform boot support from src.c" to the asoc tree Mark Brown
2015-11-10  5:12 ` [PATCH 07/13] ASoC: rsnd: remove platform boot support from ctu.c Kuninori Morimoto
2015-11-18 18:09   ` Mark Brown [this message]
2015-11-10  5:12 ` [PATCH 08/13] ASoC: rsnd: remove platform boot support from mix.c Kuninori Morimoto
2015-11-18 18:09   ` Applied "ASoC: rsnd: remove platform boot support from mix.c" to the asoc tree Mark Brown
2015-11-10  5:12 ` [PATCH 09/13] ASoC: rsnd: remove platform boot support from dvc.c Kuninori Morimoto
2015-11-18 18:09   ` Applied "ASoC: rsnd: remove platform boot support from dvc.c" to the asoc tree Mark Brown
2015-11-10  5:13 ` [PATCH 10/13] ASoC: rsnd: remove platform boot support from gen.c Kuninori Morimoto
2015-11-18 18:09   ` Applied "ASoC: rsnd: remove platform boot support from gen.c" to the asoc tree Mark Brown
2015-11-10  5:13 ` [PATCH 11/13] ASoC: rsnd: remove struct rsnd_of_data Kuninori Morimoto
2015-11-18 18:09   ` Applied "ASoC: rsnd: remove struct rsnd_of_data" to the asoc tree Mark Brown
2015-11-10  5:13 ` [PATCH 12/13] ASoC: rsnd: remove struct rcar_snd_info Kuninori Morimoto
2015-11-18 18:09   ` Applied "ASoC: rsnd: remove struct rcar_snd_info" to the asoc tree Mark Brown
2015-11-10  5:14 ` [PATCH 13/13] ASoC: rsnd: remove struct platform_device from probe/remove parameter Kuninori Morimoto
2015-11-18 18:09   ` Applied "ASoC: rsnd: remove struct platform_device from probe/remove parameter" to the asoc tree Mark Brown

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=E1Zz7Ao-0000HF-Be@debutante \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=kuninori.morimoto.gx@renesas.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.