alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: TWL4030: Module unloading fix
@ 2010-02-04  7:10 Peter Ujfalusi
  2010-02-04 10:14 ` Liam Girdwood
  2010-02-04 10:49 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Ujfalusi @ 2010-02-04  7:10 UTC (permalink / raw)
  To: alsa-devel; +Cc: broonie, lrg

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>
---
 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 e0106a5..b32aeb3 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)
 	twl4030_set_bias_level(codec, SND_SOC_BIAS_OFF);
 	snd_soc_free_pcms(socdev);
 	snd_soc_dapm_free(socdev);
-	kfree(codec->private_data);
-	kfree(codec);
 
 	return 0;
 }
@@ -2237,6 +2235,9 @@ static int __devexit twl4030_codec_remove(struct platform_device *pdev)
 {
 	struct twl4030_priv *twl4030 = platform_get_drvdata(pdev);
 
+	snd_soc_unregister_dais(&twl4030_dai[0], ARRAY_SIZE(twl4030_dai));
+	snd_soc_unregister_codec(&twl4030->codec);
+	kfree(twl4030->codec.reg_cache);
 	kfree(twl4030);
 
 	twl4030_codec = NULL;
-- 
1.6.6.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: TWL4030: Module unloading fix
  2010-02-04  7:10 [PATCH] ASoC: TWL4030: Module unloading fix Peter Ujfalusi
@ 2010-02-04 10:14 ` Liam Girdwood
  2010-02-04 10:49 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2010-02-04 10:14 UTC (permalink / raw)
  To: Peter Ujfalusi; +Cc: alsa-devel, broonie

On Thu, 2010-02-04 at 09:10 +0200, Peter Ujfalusi wrote:
> 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>

-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: TWL4030: Module unloading fix
  2010-02-04  7:10 [PATCH] ASoC: TWL4030: Module unloading fix Peter Ujfalusi
  2010-02-04 10:14 ` Liam Girdwood
@ 2010-02-04 10:49 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2010-02-04 10:49 UTC (permalink / raw)
  To: Peter Ujfalusi; +Cc: alsa-devel, lrg

On Thu, Feb 04, 2010 at 09:10:10AM +0200, Peter Ujfalusi wrote:
> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-04 10:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-04  7:10 [PATCH] ASoC: TWL4030: Module unloading fix Peter Ujfalusi
2010-02-04 10:14 ` Liam Girdwood
2010-02-04 10:49 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).