ASoC: soc-core: soc_set_name_prefix(): get component device_node at out of loop

Component device_node is not related to codec_conf loop at
soc_set_name_prefix().
This patch moves it to out of loop.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87v9qpxbkj.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto
2019-12-10 09:34:52 +09:00
committed by Mark Brown
parent 4702f99148
commit aec3ff99ce

View File

@ -1209,11 +1209,11 @@ static void soc_set_of_name_prefix(struct snd_soc_component *component)
static void soc_set_name_prefix(struct snd_soc_card *card, static void soc_set_name_prefix(struct snd_soc_card *card,
struct snd_soc_component *component) struct snd_soc_component *component)
{ {
struct device_node *of_node = soc_component_to_node(component);
int i; int i;
for (i = 0; i < card->num_configs; i++) { for (i = 0; i < card->num_configs; i++) {
struct snd_soc_codec_conf *map = &card->codec_conf[i]; struct snd_soc_codec_conf *map = &card->codec_conf[i];
struct device_node *of_node = soc_component_to_node(component);
if (map->of_node && of_node != map->of_node) if (map->of_node && of_node != map->of_node)
continue; continue;