Commit 29d9fc7a authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc-core: merge soc_set_name_prefix() and soc_set_of_name_prefix()

soc_set_name_prefix() is calling soc_set_of_name_prefix().
We don't need to separate these operation.
This patch merges these.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87fthrbhzo.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 93ec6953
...@@ -1206,22 +1206,12 @@ static int soc_init_pcm_runtime(struct snd_soc_card *card, ...@@ -1206,22 +1206,12 @@ static int soc_init_pcm_runtime(struct snd_soc_card *card,
return ret; return ret;
} }
static void soc_set_of_name_prefix(struct snd_soc_component *component)
{
struct device_node *of_node = soc_component_to_node(component);
const char *str;
int ret;
ret = of_property_read_string(of_node, "sound-name-prefix", &str);
if (!ret)
component->name_prefix = str;
}
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); struct device_node *of_node = soc_component_to_node(component);
int i; const char *str;
int ret, 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];
...@@ -1238,7 +1228,11 @@ static void soc_set_name_prefix(struct snd_soc_card *card, ...@@ -1238,7 +1228,11 @@ static void soc_set_name_prefix(struct snd_soc_card *card,
* If there is no configuration table or no match in the table, * If there is no configuration table or no match in the table,
* check if a prefix is provided in the node * check if a prefix is provided in the node
*/ */
soc_set_of_name_prefix(component); ret = of_property_read_string(of_node, "sound-name-prefix", &str);
if (ret < 0)
return;
component->name_prefix = str;
} }
static void soc_remove_component(struct snd_soc_component *component, static void soc_remove_component(struct snd_soc_component *component,
......
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