summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorVasily Khoruzhick <anarsoul@gmail.com>2018-11-08 23:31:35 -0500
committerMark Brown <broonie@kernel.org>2018-11-09 10:35:42 -0500
commit278df5e5527b633f4882f1680ad58b62a7c07bfe (patch)
tree6656611e7f9229a9ddf83ed64f762f4f798f2446 /sound
parente14856f6cfbb1b96aa45a68f188b147b5bde76b4 (diff)
ASoC: sun8i-codec: fix crash on module removal
drvdata is actually sun8i_codec, not snd_soc_card, so it crashes when calling snd_soc_card_get_drvdata(). Drop card and scodec vars anyway since we don't need to disable/unprepare clocks - it's already done by calling runtime_suspend() Drop clk_disable_unprepare() calls for the same reason. Fixes: 36c684936fae7 ("ASoC: Add sun8i digital audio codec") Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/sunxi/sun8i-codec.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/sound/soc/sunxi/sun8i-codec.c b/sound/soc/sunxi/sun8i-codec.c
index 522a72fde78d..c4196d4e5915 100644
--- a/sound/soc/sunxi/sun8i-codec.c
+++ b/sound/soc/sunxi/sun8i-codec.c
@@ -605,16 +605,10 @@ err_pm_disable:
605 605
606static int sun8i_codec_remove(struct platform_device *pdev) 606static int sun8i_codec_remove(struct platform_device *pdev)
607{ 607{
608 struct snd_soc_card *card = platform_get_drvdata(pdev);
609 struct sun8i_codec *scodec = snd_soc_card_get_drvdata(card);
610
611 pm_runtime_disable(&pdev->dev); 608 pm_runtime_disable(&pdev->dev);
612 if (!pm_runtime_status_suspended(&pdev->dev)) 609 if (!pm_runtime_status_suspended(&pdev->dev))
613 sun8i_codec_runtime_suspend(&pdev->dev); 610 sun8i_codec_runtime_suspend(&pdev->dev);
614 611
615 clk_disable_unprepare(scodec->clk_module);
616 clk_disable_unprepare(scodec->clk_bus);
617
618 return 0; 612 return 0;
619} 613}
620 614