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

From: Koro Chen
Date: Tue Jun 23 2015 - 07:02:39 EST

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 <koro.chen@xxxxxxxxxxxx>
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)
+ if (!pm_runtime_status_suspended(&pdev->dev))
+ mtk_afe_runtime_suspend(&pdev->dev);
return 0;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/