2015-06-23 11:02:36

by Koro Chen

[permalink] [raw]
Subject: [PATCH] ASoC: mediatek: Fix unbalanced calls to runtime suspend/resume

This adds call to runtime suspend in dev remove. It fixs the problem that
suspend is not called in the case of CONFIG_PM=n. It also fixs build
warning when CONFIG_PM=n.

Signed-off-by: Koro Chen <[email protected]>
---
sound/soc/mediatek/mtk-afe-pcm.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/mediatek/mtk-afe-pcm.c b/sound/soc/mediatek/mtk-afe-pcm.c
index cc228db..9863da7 100644
--- a/sound/soc/mediatek/mtk-afe-pcm.c
+++ b/sound/soc/mediatek/mtk-afe-pcm.c
@@ -1199,6 +1199,8 @@ err_pm_disable:
static int mtk_afe_pcm_dev_remove(struct platform_device *pdev)
{
pm_runtime_disable(&pdev->dev);
+ if (!pm_runtime_status_suspended(&pdev->dev))
+ mtk_afe_runtime_suspend(&pdev->dev);
snd_soc_unregister_component(&pdev->dev);
snd_soc_unregister_platform(&pdev->dev);
return 0;
--
1.8.1.1.dirty


2015-06-23 11:11:54

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] ASoC: mediatek: Fix unbalanced calls to runtime suspend/resume

On Tue, Jun 23, 2015 at 07:01:20PM +0800, Koro Chen wrote:
> This adds call to runtime suspend in dev remove. It fixs the problem that
> suspend is not called in the case of CONFIG_PM=n. It also fixs build
> warning when CONFIG_PM=n.

Applied, thanks (the stub does the right thing here if !CONFIG_PM).


Attachments:
(No filename) (303.00 B)
signature.asc (473.00 B)
Digital signature
Download all attachments