Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] ASoC: stm: Fix PM disable depth imbalance in stm32_i2s_probe
@ 2022-09-26  9:14 Zhang Qilong
  2022-09-26 12:52 ` Arnaud POULIQUEN
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang Qilong @ 2022-09-26  9:14 UTC (permalink / raw)
  To: olivier.moysan, arnaud.pouliquen, perex, tiwai, mcoquelin.stm32,
	alexandre.torgue
  Cc: alsa-devel, linux-stm32

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:efc162cbd480f ("ASoC: stm: Use dev_err_probe() helper")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 sound/soc/stm/stm32_i2s.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c
index 6aafe793eec4..5a717443b105 100644
--- a/sound/soc/stm/stm32_i2s.c
+++ b/sound/soc/stm/stm32_i2s.c
@@ -1139,12 +1139,15 @@ static int stm32_i2s_probe(struct platform_device *pdev)
 	pm_runtime_enable(&pdev->dev);
 
 	ret = snd_dmaengine_pcm_register(&pdev->dev, &stm32_i2s_pcm_config, 0);
-	if (ret)
+	if (ret) {
+		pm_runtime_disable(&pdev->dev);
 		return dev_err_probe(&pdev->dev, ret, "PCM DMA register error\n");
+	}
 
 	ret = snd_soc_register_component(&pdev->dev, &stm32_i2s_component,
 					 i2s->dai_drv, 1);
 	if (ret) {
+		pm_runtime_disable(&pdev->dev);
 		snd_dmaengine_pcm_unregister(&pdev->dev);
 		return ret;
 	}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-26 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-26  9:14 [PATCH -next] ASoC: stm: Fix PM disable depth imbalance in stm32_i2s_probe Zhang Qilong
2022-09-26 12:52 ` Arnaud POULIQUEN
2022-09-26 14:24   ` 答复: " zhangqilong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox