[alsa-devel] [PATCH 01/12 v2] ASoC: core: remove of_xlate_dai_name from snd_soc_component_driver

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Mon Mar 16 05:44:48 CET 2015


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

No one is using .of_xlate_dai_name for DT,
Let's remove it.

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

 - no change

 include/sound/soc.h  |  3 ---
 sound/soc/soc-core.c | 48 +++++++++++++++++++++---------------------------
 2 files changed, 21 insertions(+), 30 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index bc6cfab..235db71 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -713,9 +713,6 @@ struct snd_soc_component_driver {
 	void (*remove)(struct snd_soc_component *);
 
 	/* DT */
-	int (*of_xlate_dai_name)(struct snd_soc_component *component,
-				 struct of_phandle_args *args,
-				 const char **dai_name);
 	void (*seq_notifier)(struct snd_soc_component *, enum snd_soc_dapm_type,
 		int subseq);
 	int (*stream_event)(struct snd_soc_component *, int event);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index a85bd42..3a68f13 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3462,39 +3462,33 @@ static int snd_soc_get_dai_name(struct of_phandle_args *args,
 
 	mutex_lock(&client_mutex);
 	list_for_each_entry(pos, &component_list, list) {
+		int id = -1;
+
 		if (pos->dev->of_node != args->np)
 			continue;
 
-		if (pos->driver->of_xlate_dai_name) {
-			ret = pos->driver->of_xlate_dai_name(pos,
-							     args,
-							     dai_name);
-		} else {
-			int id = -1;
-
-			switch (args->args_count) {
-			case 0:
-				id = 0; /* same as dai_drv[0] */
-				break;
-			case 1:
-				id = args->args[0];
-				break;
-			default:
-				/* not supported */
-				break;
-			}
+		switch (args->args_count) {
+		case 0:
+			id = 0; /* same as dai_drv[0] */
+			break;
+		case 1:
+			id = args->args[0];
+			break;
+		default:
+			/* not supported */
+			break;
+		}
 
-			if (id < 0 || id >= pos->num_dai) {
-				ret = -EINVAL;
-				continue;
-			}
+		if (id < 0 || id >= pos->num_dai) {
+			ret = -EINVAL;
+			continue;
+		}
 
-			ret = 0;
+		ret = 0;
 
-			*dai_name = pos->dai_drv[id].name;
-			if (!*dai_name)
-				*dai_name = pos->name;
-		}
+		*dai_name = pos->dai_drv[id].name;
+		if (!*dai_name)
+			*dai_name = pos->name;
 
 		break;
 	}
-- 
1.9.1



More information about the Alsa-devel mailing list