diff options
author | Peter Ujfalusi <peter.ujfalusi@nokia.com> | 2010-02-04 02:10:10 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-02-04 05:49:04 -0500 |
commit | cb67286d6629ecb5bfc44071d664cf1cbd01a350 (patch) | |
tree | 5b70af8eb311dc44db47eec4aae68c3b945e055c /sound | |
parent | 8c1264740e7c9688c5d11b96d26e4393618ef60e (diff) |
ASoC: TWL4030: Module unloading fix
The module unloading path had several problems:
- it freed up the private structure twice
- it freed up the codec structure, which was allocated as part
of the private structure
- it did not freed up the reg_cache
- it did not unregistered the dais and the codec
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/twl4030.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index e0106a5fd40b..b32aeb38e3a6 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c | |||
@@ -2152,8 +2152,6 @@ static int twl4030_soc_remove(struct platform_device *pdev) | |||
2152 | twl4030_set_bias_level(codec, SND_SOC_BIAS_OFF); | 2152 | twl4030_set_bias_level(codec, SND_SOC_BIAS_OFF); |
2153 | snd_soc_free_pcms(socdev); | 2153 | snd_soc_free_pcms(socdev); |
2154 | snd_soc_dapm_free(socdev); | 2154 | snd_soc_dapm_free(socdev); |
2155 | kfree(codec->private_data); | ||
2156 | kfree(codec); | ||
2157 | 2155 | ||
2158 | return 0; | 2156 | return 0; |
2159 | } | 2157 | } |
@@ -2237,6 +2235,9 @@ static int __devexit twl4030_codec_remove(struct platform_device *pdev) | |||
2237 | { | 2235 | { |
2238 | struct twl4030_priv *twl4030 = platform_get_drvdata(pdev); | 2236 | struct twl4030_priv *twl4030 = platform_get_drvdata(pdev); |
2239 | 2237 | ||
2238 | snd_soc_unregister_dais(&twl4030_dai[0], ARRAY_SIZE(twl4030_dai)); | ||
2239 | snd_soc_unregister_codec(&twl4030->codec); | ||
2240 | kfree(twl4030->codec.reg_cache); | ||
2240 | kfree(twl4030); | 2241 | kfree(twl4030); |
2241 | 2242 | ||
2242 | twl4030_codec = NULL; | 2243 | twl4030_codec = NULL; |