summaryrefslogtreecommitdiffstats
path: root/sound/soc/mediatek
diff options
context:
space:
mode:
authorKoro Chen <koro.chen@mediatek.com>2015-06-23 19:01:20 +0800
committerMark Brown <broonie@kernel.org>2015-06-23 12:10:01 +0100
commit4623a614e87e4f2df08c83b5b9f68af394951dc9 (patch)
tree5a2b76b84c5cd41dcf7b039e92396f2ae345e28f /sound/soc/mediatek
parent662e8d917f685011a24492c106737ea5fdff8136 (diff)
downloadlinux-4623a614e87e4f2df08c83b5b9f68af394951dc9.tar.gz
linux-4623a614e87e4f2df08c83b5b9f68af394951dc9.tar.bz2
linux-4623a614e87e4f2df08c83b5b9f68af394951dc9.zip
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 <koro.chen@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/mediatek')
-rw-r--r--sound/soc/mediatek/mtk-afe-pcm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/mediatek/mtk-afe-pcm.c b/sound/soc/mediatek/mtk-afe-pcm.c
index cc228db5fb76..9863da73dfe0 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;