diff options
author | Jiasheng Jiang <jiasheng@iscas.ac.cn> | 2022-03-01 12:06:37 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-03-02 16:45:22 +0300 |
commit | f9e2ca0640e59d19af0ff285ee5591ed39069b09 (patch) | |
tree | 9ea8b9ad546988402c34d3c416d789a7e44a48f5 /sound/soc/atmel | |
parent | 2ecf362d220317debf5da376e0390e9f7a3f7b29 (diff) | |
download | linux-f9e2ca0640e59d19af0ff285ee5591ed39069b09.tar.xz |
ASoC: atmel_ssc_dai: Handle errors for clk_enable
As the potential failure of the clk_enable(),
it should be better to check it and return error if fals.
Fixes: cbaadf0f90d6 ("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>
Diffstat (limited to 'sound/soc/atmel')
-rw-r--r-- | sound/soc/atmel/atmel_ssc_dai.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 26e2bc690d86..c1dea8d62416 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -280,7 +280,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 */ |