aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhang Qilong <zhangqilong3@huawei.com>2020-11-11 12:13:24 +0800
committerSasha Levin <sashal@kernel.org>2021-03-23 18:51:41 -0400
commitfa60f65cd0cad66d82e3a4c683229f2cdd0df444 (patch)
treed60e66d34a8646abf940bf943c04b7a8d061bc2f
parent4cca5ee1347bad9ff6322c157917f04ef25e249b (diff)
downloadlinux-stable-fa60f65cd0cad66d82e3a4c683229f2cdd0df444.tar.gz
ASoC: wm8994: Fix PM disable depth imbalance on error
[ Upstream commit b8161cbe55a1892a19a318eaebbda92438fa708c ] 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. Fixes: 57e265c8d71fb ("ASoC: wm8994: Move runtime PM init to platform device init") Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com> Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20201111041326.1257558-2-zhangqilong3@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--sound/soc/codecs/wm8994.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 6dbab3fc6537e..0f5fa47995294 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -4480,8 +4480,12 @@ static int wm8994_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);
pm_runtime_idle(&pdev->dev);
- return devm_snd_soc_register_component(&pdev->dev, &soc_component_dev_wm8994,
+ ret = devm_snd_soc_register_component(&pdev->dev, &soc_component_dev_wm8994,
wm8994_dai, ARRAY_SIZE(wm8994_dai));
+ if (ret < 0)
+ pm_runtime_disable(&pdev->dev);
+
+ return ret;
}
static int wm8994_remove(struct platform_device *pdev)