Commit 9e9c70a5 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: soc-core: move soc_link_dai_pcm_new()

This patch moves soc_link_dai_pcm_new() to upper side.
This is prepare for its cleanup.
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/874ky9yq5o.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 50cd9b53
...@@ -1102,6 +1102,27 @@ int snd_soc_add_pcm_runtime(struct snd_soc_card *card, ...@@ -1102,6 +1102,27 @@ int snd_soc_add_pcm_runtime(struct snd_soc_card *card,
} }
EXPORT_SYMBOL_GPL(snd_soc_add_pcm_runtime); EXPORT_SYMBOL_GPL(snd_soc_add_pcm_runtime);
static int soc_link_dai_pcm_new(struct snd_soc_dai **dais, int num_dais,
struct snd_soc_pcm_runtime *rtd)
{
int i, ret = 0;
for (i = 0; i < num_dais; ++i) {
struct snd_soc_dai_driver *drv = dais[i]->driver;
if (drv->pcm_new)
ret = drv->pcm_new(rtd, dais[i]);
if (ret < 0) {
dev_err(dais[i]->dev,
"ASoC: Failed to bind %s with pcm device\n",
dais[i]->name);
return ret;
}
}
return 0;
}
static void soc_set_of_name_prefix(struct snd_soc_component *component) static void soc_set_of_name_prefix(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);
...@@ -1379,27 +1400,6 @@ static int soc_probe_link_components(struct snd_soc_card *card) ...@@ -1379,27 +1400,6 @@ static int soc_probe_link_components(struct snd_soc_card *card)
return 0; return 0;
} }
static int soc_link_dai_pcm_new(struct snd_soc_dai **dais, int num_dais,
struct snd_soc_pcm_runtime *rtd)
{
int i, ret = 0;
for (i = 0; i < num_dais; ++i) {
struct snd_soc_dai_driver *drv = dais[i]->driver;
if (drv->pcm_new)
ret = drv->pcm_new(rtd, dais[i]);
if (ret < 0) {
dev_err(dais[i]->dev,
"ASoC: Failed to bind %s with pcm device\n",
dais[i]->name);
return ret;
}
}
return 0;
}
static int soc_link_init(struct snd_soc_card *card, static int soc_link_init(struct snd_soc_card *card,
struct snd_soc_pcm_runtime *rtd) struct snd_soc_pcm_runtime *rtd)
{ {
......
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