Skip to contentSkip to conversation

ASoC: Set sgtl5000->ldo in ldo_regulator_register

PATCH Applied Axel Lin 4 participants 4 messages Oct 20, 2011 – Oct 21, 2011

Subsystems (3)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 ASoC: Set sgtl5000->ldo in ldo_regulator_register

Otherwise calling ldo_regulator_remove() does not unregister regulator and free memories.

---
 sound/soc/codecs/sgtl5000.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
sound/soc/codecs/sgtl5000.c +2 -0
index 3637a62..8395002 100644
@@ -806,6 +806,7 @@ static int ldo_regulator_register(struct snd_soc_codec *codec,
 				int voltage)
 {
 	struct ldo_regulator *ldo;
+	struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec);
 
 	ldo = kzalloc(sizeof(struct ldo_regulator), GFP_KERNEL);
 
@@ -840,6 +841,7 @@ static int ldo_regulator_register(struct snd_soc_codec *codec,
 
 		return ret;
 	}
+	sgtl5000->ldo = ldo;
 
 	return 0;
 }
Signature · 1 line
1.7.5.4
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Axel Lin

Otherwise calling ldo_regulator_remove() does not unregister regulator and free memories.

BTW I think it is better to CC "Dong Aisheng <[email protected]>" instead of Zeng Zhaoming; he was lately working with sgtl5000.

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Applied
#3 lore raw
In reply to Axel Lin
Quoted 2 lines · Axel Lin

Otherwise calling ldo_regulator_remove() does not unregister regulator and free memories.

Applied, thanks.