Commit e5f0d490 authored by Chuhong Yuan's avatar Chuhong Yuan Committed by Mark Brown

ASoC: Intel: sof-rt5682: add a check for devm_clk_get

sof_audio_probe misses a check for devm_clk_get and may cause problems.
Add a check for it to fix the bug.
Signed-off-by: default avatarChuhong Yuan <hslester96@gmail.com>
Acked-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191017025044.31474-1-hslester96@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 22e58665
......@@ -603,6 +603,15 @@ static int sof_audio_probe(struct platform_device *pdev)
/* need to get main clock from pmc */
if (sof_rt5682_quirk & SOF_RT5682_MCLK_BYTCHT_EN) {
ctx->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");
if (IS_ERR(ctx->mclk)) {
ret = PTR_ERR(ctx->mclk);
dev_err(&pdev->dev,
"Failed to get MCLK from pmc_plt_clk_3: %d\n",
ret);
return ret;
}
ret = clk_prepare_enable(ctx->mclk);
if (ret < 0) {
dev_err(&pdev->dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment