]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ASoC: pcm512x: Fix PM disable depth imbalance in pcm512x_probe
authorZhang Qilong <zhangqilong3@huawei.com>
Wed, 28 Sep 2022 16:04:02 +0000 (00:04 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:08 +0000 (11:41 +0100)
[ Upstream commit 97b801be6f8e53676b9f2b105f54e35c745c1b22 ]

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:976c03079245e ("ASoC: pcm512x: Support mastering BCLK/LRCLK using the PLL")

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20220928160402.126140-1-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/codecs/pcm512x.c

index 4cbef9affffda95ce6af991a40d8310cf11ed13d..feb590a20544745feb3500df1da6041c629674e6 100644 (file)
@@ -1598,7 +1598,7 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap)
                        if (val > 6) {
                                dev_err(dev, "Invalid pll-in\n");
                                ret = -EINVAL;
-                               goto err_clk;
+                               goto err_pm;
                        }
                        pcm512x->pll_in = val;
                }
@@ -1607,7 +1607,7 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap)
                        if (val > 6) {
                                dev_err(dev, "Invalid pll-out\n");
                                ret = -EINVAL;
-                               goto err_clk;
+                               goto err_pm;
                        }
                        pcm512x->pll_out = val;
                }
@@ -1616,12 +1616,12 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap)
                        dev_err(dev,
                                "Error: both pll-in and pll-out, or none\n");
                        ret = -EINVAL;
-                       goto err_clk;
+                       goto err_pm;
                }
                if (pcm512x->pll_in && pcm512x->pll_in == pcm512x->pll_out) {
                        dev_err(dev, "Error: pll-in == pll-out\n");
                        ret = -EINVAL;
-                       goto err_clk;
+                       goto err_pm;
                }
        }
 #endif