ASoC: atmel-pdmic: add missing clk_disable_unprepare() on error in atmel_pdmic_cpu_dai_startup()

Add the missing clk_disable_unprepare() before return from
atmel_pdmic_cpu_dai_startup() in the error handling case.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Wei Yongjun 2016-08-10 13:53:21 +00:00 committed by Mark Brown
parent 6b0ffacdaf
commit 61743bfaf0
1 changed files with 3 additions and 1 deletions

View File

@ -115,8 +115,10 @@ static int atmel_pdmic_cpu_dai_startup(struct snd_pcm_substream *substream,
return ret;
ret = clk_prepare_enable(dd->pclk);
if (ret)
if (ret) {
clk_disable_unprepare(dd->gclk);
return ret;
}
/* Clear all bits in the Control Register(PDMIC_CR) */
regmap_write(dd->regmap, PDMIC_CR, 0);