ASoC: mxs-saif: Handle errors for clk_enable

[ Upstream commit 2ecf362d220317debf5da376e0390e9f7a3f7b29 ]

As the potential failure of the clk_enable(),
it should be better to check it, like mxs_saif_trigger().

Fixes: d0ba4c0149 ("ASoC: mxs-saif: set a base clock rate for EXTMASTER mode work")
Signed-off-by: Jiasheng Jiang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
Jiasheng Jiang 2022-03-01 16:17:17 +08:00 • committed by Greg Kroah-Hartman
commit fd0c4082fd

View file

@ -455,7 +455,10 @@ static int mxs_saif_hw_params(struct snd_pcm_substream *substream,
* basic clock which should be fast enough for the internal
* logic.
*/
clk_enable(saif->clk);
ret = clk_enable(saif->clk);
if (ret)
return ret;
ret = clk_set_rate(saif->clk, 24000000);
clk_disable(saif->clk);
if (ret)