summaryrefslogtreecommitdiff
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-05-13 10:07:20 +0300
committerMark Brown <broonie@kernel.org>2019-05-13 14:44:51 +0300
commit09d4cc03ff77790872b8b9e51b6d7b5863686fc5 (patch)
treec2ad98a3e4aaeeec250855c1190191b5ab572db2 /sound/soc/soc-core.c
parentc083444061ada428af71809cc12fd8f06dd2be19 (diff)
downloadlinux-09d4cc03ff77790872b8b9e51b6d7b5863686fc5.tar.xz
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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index e55170ce6d3e..e83edbe27041 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3751,7 +3751,7 @@ EXPORT_SYMBOL_GPL(snd_soc_of_parse_daifmt);
int snd_soc_get_dai_id(struct device_node *ep)
{
- struct snd_soc_component *pos;
+ struct snd_soc_component *component;
struct device_node *node;
int ret;
@@ -3765,17 +3765,10 @@ int snd_soc_get_dai_id(struct device_node *ep)
*/
ret = -ENOTSUPP;
mutex_lock(&client_mutex);
- for_each_component(pos) {
- struct device_node *component_of_node = soc_component_to_node(pos);
-
- if (component_of_node != node)
- continue;
-
- if (pos->driver->of_xlate_dai_id)
- ret = pos->driver->of_xlate_dai_id(pos, ep);
-
- break;
- }
+ component = soc_find_component(node, NULL);
+ if (component &&
+ component->driver->of_xlate_dai_id)
+ ret = component->driver->of_xlate_dai_id(component, ep);
mutex_unlock(&client_mutex);
of_node_put(node);