Skip to content

Commit

Permalink
ASoC: Only unregister drivers we registered for WM8753
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Feb 22, 2009
1 parent eeb1080 commit 93e051d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sound/soc/codecs/wm8753.c
Original file line number Diff line number Diff line change
Expand Up @@ -1845,18 +1845,22 @@ static int wm8753_remove(struct platform_device *pdev)
{
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
struct snd_soc_codec *codec = socdev->card->codec;
struct wm8753_setup_data *setup = socdev->codec_data;

if (codec->control_data)
wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF);
run_delayed_work(&codec->delayed_work);
snd_soc_free_pcms(socdev);
snd_soc_dapm_free(socdev);
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
i2c_unregister_device(codec->control_data);
i2c_del_driver(&wm8753_i2c_driver);
if (setup->i2c_address) {
i2c_unregister_device(codec->control_data);
i2c_del_driver(&wm8753_i2c_driver);
}
#endif
#if defined(CONFIG_SPI_MASTER)
spi_unregister_driver(&wm8753_spi_driver);
if (setup->spi)
spi_unregister_driver(&wm8753_spi_driver);
#endif
kfree(codec->private_data);
kfree(codec);
Expand Down

0 comments on commit 93e051d

Please sign in to comment.