From d51af79dc255be3833cab5019428e7c50f22ce92 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 20 Oct 2011 18:32:59 +0800 Subject: ASoC: Set sgtl5000->ldo in ldo_regulator_register Otherwise calling ldo_regulator_remove() does not unregister regulator and free memories. Signed-off-by: Axel Lin Acked-by: Wolfram Sang Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/codecs/sgtl5000.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound/soc') diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 3637a62ddeb4..83950022b96e 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -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; } -- cgit v1.2.3