Skip to content

Commit

Permalink
ASoC: arizona: call wm_adsp2_remove when codec driver is removed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Richard Fitzgerald authored and Mark Brown committed Apr 27, 2016
1 parent 66225e9 commit 401cf14
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sound/soc/codecs/cs47l24.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 4 additions & 0 deletions sound/soc/codecs/wm5102.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 6 additions & 0 deletions sound/soc/codecs/wm5110.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 401cf14

Please sign in to comment.