Skip to content

Commit

Permalink
ASoC: soc-core: move snd_soc_get_pcm_runtime()
Browse files Browse the repository at this point in the history
This patch moves snd_soc_get_pcm_runtime() next to
snd_soc_get_dai_substream().
This is prepare for snd_soc_get_pcm_runtime() cleanup.

Signed-off-by: Kuninori Morimoto <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
morimoto authored and broonie committed Dec 10, 2019
1 parent 8babfb7 commit 94def8e
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,21 @@ EXPORT_SYMBOL_GPL(snd_soc_lookup_component);

static const struct snd_soc_ops null_snd_soc_ops;

struct snd_soc_pcm_runtime
*snd_soc_get_pcm_runtime(struct snd_soc_card *card,
const char *dai_link)
{
struct snd_soc_pcm_runtime *rtd;

for_each_card_rtds(card, rtd) {
if (!strcmp(rtd->dai_link->name, dai_link))
return rtd;
}
dev_dbg(card->dev, "ASoC: failed to find rtd %s\n", dai_link);
return NULL;
}
EXPORT_SYMBOL_GPL(snd_soc_get_pcm_runtime);

static void soc_release_rtd_dev(struct device *dev)
{
/* "dev" means "rtd->dev" */
Expand Down Expand Up @@ -491,20 +506,6 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime(
return NULL;
}

struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card,
const char *dai_link)
{
struct snd_soc_pcm_runtime *rtd;

for_each_card_rtds(card, rtd) {
if (!strcmp(rtd->dai_link->name, dai_link))
return rtd;
}
dev_dbg(card->dev, "ASoC: failed to find rtd %s\n", dai_link);
return NULL;
}
EXPORT_SYMBOL_GPL(snd_soc_get_pcm_runtime);

static void snd_soc_flush_all_delayed_work(struct snd_soc_card *card)
{
struct snd_soc_pcm_runtime *rtd;
Expand Down

0 comments on commit 94def8e

Please sign in to comment.