Commit 97b801be authored by Zhang Qilong's avatar Zhang Qilong Committed by Mark Brown

ASoC: pcm512x: Fix PM disable depth imbalance in pcm512x_probe

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 going to
err_pm instead of err_clk.

Fixes:f086ba9d ("ASoC: pcm512x: Support mastering BCLK/LRCLK using the PLL")
Signed-off-by: default avatarZhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20220928160402.126140-1-zhangqilong3@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent f4f473f8
...@@ -1634,7 +1634,7 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap) ...@@ -1634,7 +1634,7 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap)
if (val > 6) { if (val > 6) {
dev_err(dev, "Invalid pll-in\n"); dev_err(dev, "Invalid pll-in\n");
ret = -EINVAL; ret = -EINVAL;
goto err_clk; goto err_pm;
} }
pcm512x->pll_in = val; pcm512x->pll_in = val;
} }
...@@ -1643,7 +1643,7 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap) ...@@ -1643,7 +1643,7 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap)
if (val > 6) { if (val > 6) {
dev_err(dev, "Invalid pll-out\n"); dev_err(dev, "Invalid pll-out\n");
ret = -EINVAL; ret = -EINVAL;
goto err_clk; goto err_pm;
} }
pcm512x->pll_out = val; pcm512x->pll_out = val;
} }
...@@ -1652,12 +1652,12 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap) ...@@ -1652,12 +1652,12 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap)
dev_err(dev, dev_err(dev,
"Error: both pll-in and pll-out, or none\n"); "Error: both pll-in and pll-out, or none\n");
ret = -EINVAL; ret = -EINVAL;
goto err_clk; goto err_pm;
} }
if (pcm512x->pll_in && pcm512x->pll_in == pcm512x->pll_out) { if (pcm512x->pll_in && pcm512x->pll_in == pcm512x->pll_out) {
dev_err(dev, "Error: pll-in == pll-out\n"); dev_err(dev, "Error: pll-in == pll-out\n");
ret = -EINVAL; ret = -EINVAL;
goto err_clk; goto err_pm;
} }
} }
#endif #endif
......
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