Skip to content

Commit

Permalink
ASoC: Set sgtl5000->ldo in ldo_regulator_register
Browse files Browse the repository at this point in the history
Otherwise calling ldo_regulator_remove() does not unregister regulator
and free memories.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Wolfram Sang <[email protected]>
Acked-by: Liam Girdwood <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
AxelLin authored and broonie committed Oct 21, 2011
1 parent ff39dbe commit 5b13de7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/soc/codecs/sgtl5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -840,6 +841,7 @@ static int ldo_regulator_register(struct snd_soc_codec *codec,

return ret;
}
sgtl5000->ldo = ldo;

return 0;
}
Expand Down

0 comments on commit 5b13de7

Please sign in to comment.