From: Axel Lin Date: Thu, 20 Oct 2011 10:32:59 +0000 (+0800) Subject: ASoC: Set sgtl5000->ldo in ldo_regulator_register X-Git-Tag: next-20111025~52^2~7 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5b13de7aa754eaa274fc9ab018191bcdcb21bc45;p=karo-tx-linux.git 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 --- 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; }