ASoC: soc-core: use soc_find_component() at snd_soc_find_dai()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 20 Jun 2019 00:49:33 +0000 (09:49 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 24 Jun 2019 16:24:03 +0000 (17:24 +0100)
snd_soc_find_dai() finds component first via specified
snd_soc_dai_link_component, and find DAI from it.

We already have soc_find_component() to find component,
but soc_find_dai() has original implementation to find component.

We shouldn't have duplicate implementation to do same things.
This patch uses soc_find_component() at soc_find_dai()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-core.c

index 1749f4af91b697bfbc83e1620397fafcdceff6c9..358f1fbf9a300b16b5d73473de5a78f1c7d42fb0 100644 (file)
@@ -813,9 +813,8 @@ struct snd_soc_dai *snd_soc_find_dai(
        lockdep_assert_held(&client_mutex);
 
        /* Find CPU DAI from registered DAIs */
-       for_each_component(component) {
-               if (!snd_soc_is_matching_component(dlc, component))
-                       continue;
+       component = soc_find_component(dlc);
+       if (component) {
                for_each_component_dais(component, dai) {
                        if (dlc->dai_name && strcmp(dai->name, dlc->dai_name)
                            && (!dai->driver->name