lkml.org 
[lkml]   [2019]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.3 058/140] ASoC: Intel: sof-rt5682: add a check for devm_clk_get
    Date
    From: Chuhong Yuan <hslester96@gmail.com>

    [ Upstream commit e5f0d490fb718254a884453e47fcd48493cd67ea ]

    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: Chuhong Yuan <hslester96@gmail.com>
    Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Link: https://lore.kernel.org/r/20191017025044.31474-1-hslester96@gmail.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    sound/soc/intel/boards/sof_rt5682.c | 9 +++++++++
    1 file changed, 9 insertions(+)

    diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c
    index 239eef128c2b7..9e59586e03bac 100644
    --- a/sound/soc/intel/boards/sof_rt5682.c
    +++ b/sound/soc/intel/boards/sof_rt5682.c
    @@ -573,6 +573,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,
    --
    2.20.1


    \
     
     \ /
      Last update: 2019-11-08 20:14    [W:4.197 / U:0.036 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site