diff options
author | Axel Lin <axel.lin@gmail.com> | 2010-11-19 04:31:08 -0500 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-11-19 07:14:47 -0500 |
commit | 5b3b0fa8fb0db9645b56361cdc9a9d0ddbc35e4d (patch) | |
tree | 8c360d75728a96a5064bb609e87d13647b02c8ca | |
parent | 0656f6cf6c394ede78657595dd5a8ca7a1e64853 (diff) |
ASoC: Move kfree(twl4030) to twl4030_soc_remove()
As we allocate memory for twl4030 in twl4030_codec_probe(),
twl4030_codec_remove() is a better place to free the memory.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
-rw-r--r-- | sound/soc/codecs/twl4030.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index a6ceddb0bb7d..3820885c8c2a 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c | |||
@@ -2272,9 +2272,12 @@ static int twl4030_soc_probe(struct snd_soc_codec *codec) | |||
2272 | 2272 | ||
2273 | static int twl4030_soc_remove(struct snd_soc_codec *codec) | 2273 | static int twl4030_soc_remove(struct snd_soc_codec *codec) |
2274 | { | 2274 | { |
2275 | struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); | ||
2276 | |||
2275 | /* Reset registers to their chip default before leaving */ | 2277 | /* Reset registers to their chip default before leaving */ |
2276 | twl4030_reset_registers(codec); | 2278 | twl4030_reset_registers(codec); |
2277 | twl4030_set_bias_level(codec, SND_SOC_BIAS_OFF); | 2279 | twl4030_set_bias_level(codec, SND_SOC_BIAS_OFF); |
2280 | kfree(twl4030); | ||
2278 | return 0; | 2281 | return 0; |
2279 | } | 2282 | } |
2280 | 2283 | ||
@@ -2306,10 +2309,7 @@ static int __devinit twl4030_codec_probe(struct platform_device *pdev) | |||
2306 | 2309 | ||
2307 | static int __devexit twl4030_codec_remove(struct platform_device *pdev) | 2310 | static int __devexit twl4030_codec_remove(struct platform_device *pdev) |
2308 | { | 2311 | { |
2309 | struct twl4030_priv *twl4030 = dev_get_drvdata(&pdev->dev); | ||
2310 | |||
2311 | snd_soc_unregister_codec(&pdev->dev); | 2312 | snd_soc_unregister_codec(&pdev->dev); |
2312 | kfree(twl4030); | ||
2313 | return 0; | 2313 | return 0; |
2314 | } | 2314 | } |
2315 | 2315 | ||