diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2019-12-11 13:31:39 +0900 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-12-11 16:43:16 +0000 |
commit | 29d9fc7acacbb985daa1b4c662c619dc959a11b0 (patch) | |
tree | cf1314a055997ae9c995ec75e56f59e8fc2cb2ff /sound/soc/soc-core.c | |
parent | 93ec6953c1d7b3c5f62d35c76fe6670c6d9b3c8c (diff) | |
download | linux-29d9fc7acacbb985daa1b4c662c619dc959a11b0.tar.bz2 |
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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87fthrbhzo.wl-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.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 750469acd5b4..f8090bd2cf73 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1206,22 +1206,12 @@ static int soc_init_pcm_runtime(struct snd_soc_card *card, 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, struct snd_soc_component *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++) { 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, * If there is no configuration table or no match in the table, * 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, |