Skip to content

Commit

Permalink
ASoC: fsl: Fix PM disable depth imbalance in fsl_easrc_probe
Browse files Browse the repository at this point in the history
The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context. We fix it by calling
pm_runtime_disable when error returns.

Fixes: 955ac62 ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers")
Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Link: https://lore.kernel.org/r/tencent_C0D62E6D89818179A02A04A0C248F0DDC40A@qq.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Zhang Shurong authored and Mark Brown committed Oct 23, 2023
1 parent e8ecffd commit 9e630ef
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sound/soc/fsl/fsl_easrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1966,17 +1966,21 @@ static int fsl_easrc_probe(struct platform_device *pdev)
&fsl_easrc_dai, 1);
if (ret) {
dev_err(dev, "failed to register ASoC DAI\n");
return ret;
goto err_pm_disable;
}

ret = devm_snd_soc_register_component(dev, &fsl_asrc_component,
NULL, 0);
if (ret) {
dev_err(&pdev->dev, "failed to register ASoC platform\n");
return ret;
goto err_pm_disable;
}

return 0;

err_pm_disable:
pm_runtime_disable(&pdev->dev);
return ret;
}

static void fsl_easrc_remove(struct platform_device *pdev)
Expand Down

0 comments on commit 9e630ef

Please sign in to comment.