diff mbox

[01/12,v2] ASoC: core: remove of_xlate_dai_name from snd_soc_component_driver

Message ID 87d249k0ut.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kuninori Morimoto March 16, 2015, 4:44 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

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

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

 - no change

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

Comments

Lars-Peter Clausen March 18, 2015, 9:03 a.m. UTC | #1
On 03/16/2015 05:44 AM, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> No one is using .of_xlate_dai_name for DT,
> Let's remove it.

I'd prefer to keep this, there will probably be user for it eventually.
Kuninori Morimoto March 18, 2015, 11:59 p.m. UTC | #2
Hi Lars

> > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> >
> > No one is using .of_xlate_dai_name for DT,
> > Let's remove it.
> 
> I'd prefer to keep this, there will probably be user for it eventually.

OK, will fix in v3
diff mbox

Patch

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;
 	}