]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ASoC: arizona: call wm_adsp2_remove when codec driver is removed
authorRichard Fitzgerald <rf@opensource.wolfsonmicro.com>
Wed, 27 Apr 2016 13:58:28 +0000 (14:58 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 27 Apr 2016 15:21:23 +0000 (16:21 +0100)
Ensure that the wm_adsp driver cleans up when the codec driver
is removed.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs47l24.c
sound/soc/codecs/wm5102.c
sound/soc/codecs/wm5110.c

index 576087bda330ce840bdb4f90777ee7c9f1d580d9..29313780a38a9db618329a11036b1bf87546849c 100644 (file)
@@ -1238,10 +1238,15 @@ static int cs47l24_probe(struct platform_device *pdev)
 
 static int cs47l24_remove(struct platform_device *pdev)
 {
+       struct cs47l24_priv *cs47l24 = platform_get_drvdata(pdev);
+
        snd_soc_unregister_platform(&pdev->dev);
        snd_soc_unregister_codec(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
 
+       wm_adsp2_remove(&cs47l24->core.adsp[1]);
+       wm_adsp2_remove(&cs47l24->core.adsp[2]);
+
        return 0;
 }
 
index a8b3e3f701f964bdd3b54869a655d9cbfec74264..7a539e0529c0101fd70e0cd749f007a0abf0a7df 100644 (file)
@@ -2093,10 +2093,14 @@ static int wm5102_probe(struct platform_device *pdev)
 
 static int wm5102_remove(struct platform_device *pdev)
 {
+       struct wm5102_priv *wm5102 = platform_get_drvdata(pdev);
+
        snd_soc_unregister_platform(&pdev->dev);
        snd_soc_unregister_codec(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
 
+       wm_adsp2_remove(&wm5102->core.adsp[0]);
+
        return 0;
 }
 
index 83ba70fe16e69488a473a68bcc97d4cc2408874f..dd87af1ffa23b854aaf25f0b13705977ccdfee79 100644 (file)
@@ -2435,10 +2435,16 @@ static int wm5110_probe(struct platform_device *pdev)
 
 static int wm5110_remove(struct platform_device *pdev)
 {
+       struct wm5110_priv *wm5110 = platform_get_drvdata(pdev);
+       int i;
+
        snd_soc_unregister_platform(&pdev->dev);
        snd_soc_unregister_codec(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
 
+       for (i = 0; i < WM5110_NUM_ADSP; i++)
+               wm_adsp2_remove(&wm5110->core.adsp[i]);
+
        return 0;
 }