Skip to content

Commit

Permalink
ASoC: atmel_ssc_dai: Handle errors for clk_enable
Browse files Browse the repository at this point in the history
[ Upstream commit f9e2ca0 ]

As the potential failure of the clk_enable(),
it should be better to check it and return error if fals.

Fixes: cbaadf0 ("ASoC: atmel_ssc_dai: refactor the startup and shutdown")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20220301090637.3776558-1-jiasheng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
JiangJias authored and gregkh committed Apr 5, 2022
1 parent 3e74974 commit a9de401
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sound/soc/atmel/atmel_ssc_dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,10 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream,

/* Enable PMC peripheral clock for this SSC */
pr_debug("atmel_ssc_dai: Starting clock\n");
clk_enable(ssc_p->ssc->clk);
ret = clk_enable(ssc_p->ssc->clk);
if (ret)
return ret;

ssc_p->mck_rate = clk_get_rate(ssc_p->ssc->clk);

/* Reset the SSC unless initialized to keep it in a clean state */
Expand Down

0 comments on commit a9de401

Please sign in to comment.