mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
ASoC: ti: j721e-evm: Fix unbalanced domain activity tracking during startup
In case of an error within j721e_audio_startup() the domain->active must be decremented to avoid unbalanced counter. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com> Link: https://lore.kernel.org/r/20210717122820.1467-2-peter.ujfalusi@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
6a503e1c45
commit
78d2a05ef2
1 changed files with 11 additions and 5 deletions
|
@ -278,23 +278,29 @@ static int j721e_audio_startup(struct snd_pcm_substream *substream)
|
||||||
j721e_rule_rate, &priv->rate_range,
|
j721e_rule_rate, &priv->rate_range,
|
||||||
SNDRV_PCM_HW_PARAM_RATE, -1);
|
SNDRV_PCM_HW_PARAM_RATE, -1);
|
||||||
|
|
||||||
mutex_unlock(&priv->mutex);
|
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto out;
|
||||||
|
|
||||||
/* Reset TDM slots to 32 */
|
/* Reset TDM slots to 32 */
|
||||||
ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0x3, 0x3, 2, 32);
|
ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0x3, 0x3, 2, 32);
|
||||||
if (ret && ret != -ENOTSUPP)
|
if (ret && ret != -ENOTSUPP)
|
||||||
return ret;
|
goto out;
|
||||||
|
|
||||||
for_each_rtd_codec_dais(rtd, i, codec_dai) {
|
for_each_rtd_codec_dais(rtd, i, codec_dai) {
|
||||||
ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x3, 0x3, 2, 32);
|
ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x3, 0x3, 2, 32);
|
||||||
if (ret && ret != -ENOTSUPP)
|
if (ret && ret != -ENOTSUPP)
|
||||||
return ret;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
if (ret == -ENOTSUPP)
|
||||||
|
ret = 0;
|
||||||
|
out:
|
||||||
|
if (ret)
|
||||||
|
domain->active--;
|
||||||
|
mutex_unlock(&priv->mutex);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int j721e_audio_hw_params(struct snd_pcm_substream *substream,
|
static int j721e_audio_hw_params(struct snd_pcm_substream *substream,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue