ASoC: wm5102: Fix PM disable depth imbalance in wm5102_probe
authorZhang Qilong <zhangqilong3@huawei.com>
Thu, 29 Sep 2022 15:06:52 +0000 (23:06 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 3 Oct 2022 17:37:56 +0000 (18:37 +0100)
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:93e8791dd34ca ("ASoC: wm5102: Initial driver")

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220929150653.63845-4-zhangqilong3@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wm5102.c

index c09c9ac..e56e30d 100644 (file)
@@ -2142,6 +2142,7 @@ err_dsp_irq:
        arizona_set_irq_wake(arizona, ARIZONA_IRQ_DSP_IRQ1, 0);
        arizona_free_irq(arizona, ARIZONA_IRQ_DSP_IRQ1, wm5102);
 err_jack_codec_dev:
+       pm_runtime_disable(&pdev->dev);
        arizona_jack_codec_dev_remove(&wm5102->core);
 
        return ret;