Commit a9ec8496 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc-core: soc_find_component() uses snd_soc_is_matching_component()

ALSA SoC already has snd_soc_is_matching_component() to confirming
matching component, but, soc_find_component() has original
implementation to confirm component.

We shouldn't have duplicate implementation to do same things.
This patch uses snd_soc_is_matching_component() at soc_find_component()
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7d7db5d3
...@@ -780,22 +780,18 @@ static int snd_soc_is_matching_component( ...@@ -780,22 +780,18 @@ static int snd_soc_is_matching_component(
} }
static struct snd_soc_component *soc_find_component( static struct snd_soc_component *soc_find_component(
const struct device_node *of_node, const char *name) struct device_node *of_node, const char *name)
{ {
struct snd_soc_component *component; struct snd_soc_component *component;
struct device_node *component_of_node; struct snd_soc_dai_link_component dlc;
lockdep_assert_held(&client_mutex); lockdep_assert_held(&client_mutex);
for_each_component(component) { for_each_component(component) {
if (of_node) { dlc.name = name;
component_of_node = soc_component_to_node(component); dlc.of_node = of_node;
if (snd_soc_is_matching_component(&dlc, component))
if (component_of_node == of_node)
return component;
} else if (name && strcmp(component->name, name) == 0) {
return component; return component;
}
} }
return NULL; return NULL;
......
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