aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-02-22 09:24:00 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-02-22 09:24:00 -0500
commit93e051d2771e6bf70e86b8265bfbf296a457d044 (patch)
treeb2e17e343625a973b7ab541b9ce2610177a142bc
parenteeb1080b29a0fa00e426ba77eb96f3a157b335ab (diff)
ASoC: Only unregister drivers we registered for WM8753
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/codecs/wm8753.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
index 180ec94ad8ae..93c22c4f0826 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -1845,6 +1845,7 @@ static int wm8753_remove(struct platform_device *pdev)
1845{ 1845{
1846 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 1846 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
1847 struct snd_soc_codec *codec = socdev->card->codec; 1847 struct snd_soc_codec *codec = socdev->card->codec;
1848 struct wm8753_setup_data *setup = socdev->codec_data;
1848 1849
1849 if (codec->control_data) 1850 if (codec->control_data)
1850 wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF); 1851 wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF);
@@ -1852,11 +1853,14 @@ static int wm8753_remove(struct platform_device *pdev)
1852 snd_soc_free_pcms(socdev); 1853 snd_soc_free_pcms(socdev);
1853 snd_soc_dapm_free(socdev); 1854 snd_soc_dapm_free(socdev);
1854#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 1855#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
1855 i2c_unregister_device(codec->control_data); 1856 if (setup->i2c_address) {
1856 i2c_del_driver(&wm8753_i2c_driver); 1857 i2c_unregister_device(codec->control_data);
1858 i2c_del_driver(&wm8753_i2c_driver);
1859 }
1857#endif 1860#endif
1858#if defined(CONFIG_SPI_MASTER) 1861#if defined(CONFIG_SPI_MASTER)
1859 spi_unregister_driver(&wm8753_spi_driver); 1862 if (setup->spi)
1863 spi_unregister_driver(&wm8753_spi_driver);
1860#endif 1864#endif
1861 kfree(codec->private_data); 1865 kfree(codec->private_data);
1862 kfree(codec); 1866 kfree(codec);