ASoC: soc-pcm: move dpcm_fe_dai_close()
move dpcm_fe_dai_close() next to dpcm_fe_dai_open(). This is prepare for dpcm_fe_dai_open() cleanup Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87pndqp9uv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
6e02feb0d2
commit
30fca26f8e
|
@ -2978,6 +2978,26 @@ out:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int dpcm_fe_dai_close(struct snd_pcm_substream *fe_substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *fe = fe_substream->private_data;
|
||||
struct snd_soc_dpcm *dpcm;
|
||||
int stream = fe_substream->stream, ret;
|
||||
|
||||
mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
|
||||
ret = dpcm_fe_dai_shutdown(fe_substream);
|
||||
|
||||
/* mark FE's links ready to prune */
|
||||
for_each_dpcm_be(fe, stream, dpcm)
|
||||
dpcm->state = SND_SOC_DPCM_LINK_STATE_FREE;
|
||||
|
||||
dpcm_be_disconnect(fe, stream);
|
||||
|
||||
fe->dpcm[stream].runtime = NULL;
|
||||
mutex_unlock(&fe->card->mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int dpcm_fe_dai_open(struct snd_pcm_substream *fe_substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *fe = fe_substream->private_data;
|
||||
|
@ -3017,26 +3037,6 @@ open_end:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int dpcm_fe_dai_close(struct snd_pcm_substream *fe_substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *fe = fe_substream->private_data;
|
||||
struct snd_soc_dpcm *dpcm;
|
||||
int stream = fe_substream->stream, ret;
|
||||
|
||||
mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
|
||||
ret = dpcm_fe_dai_shutdown(fe_substream);
|
||||
|
||||
/* mark FE's links ready to prune */
|
||||
for_each_dpcm_be(fe, stream, dpcm)
|
||||
dpcm->state = SND_SOC_DPCM_LINK_STATE_FREE;
|
||||
|
||||
dpcm_be_disconnect(fe, stream);
|
||||
|
||||
fe->dpcm[stream].runtime = NULL;
|
||||
mutex_unlock(&fe->card->mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* create a new pcm */
|
||||
int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue