Commit 09d4cc03 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc-core: use soc_find_component() at snd_soc_get_dai_id()

soc-core core already has soc_find_component() which find
component from device node.
Let's use existing function to find component.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent c0834440
...@@ -3751,7 +3751,7 @@ EXPORT_SYMBOL_GPL(snd_soc_of_parse_daifmt); ...@@ -3751,7 +3751,7 @@ EXPORT_SYMBOL_GPL(snd_soc_of_parse_daifmt);
int snd_soc_get_dai_id(struct device_node *ep) int snd_soc_get_dai_id(struct device_node *ep)
{ {
struct snd_soc_component *pos; struct snd_soc_component *component;
struct device_node *node; struct device_node *node;
int ret; int ret;
...@@ -3765,17 +3765,10 @@ int snd_soc_get_dai_id(struct device_node *ep) ...@@ -3765,17 +3765,10 @@ int snd_soc_get_dai_id(struct device_node *ep)
*/ */
ret = -ENOTSUPP; ret = -ENOTSUPP;
mutex_lock(&client_mutex); mutex_lock(&client_mutex);
for_each_component(pos) { component = soc_find_component(node, NULL);
struct device_node *component_of_node = soc_component_to_node(pos); if (component &&
component->driver->of_xlate_dai_id)
if (component_of_node != node) ret = component->driver->of_xlate_dai_id(component, ep);
continue;
if (pos->driver->of_xlate_dai_id)
ret = pos->driver->of_xlate_dai_id(pos, ep);
break;
}
mutex_unlock(&client_mutex); mutex_unlock(&client_mutex);
of_node_put(node); of_node_put(node);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment