summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2012-09-10 10:46:30 (GMT)
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-22 15:18:32 (GMT)
commitf2b1ce4949d6b52a9224118efb562a94e9b5d400 (patch)
tree116c2f3fe893f82c42b0b32f085c622f4b5636bf
parentd0b3847b40f8da4b90b22db0f3678ba68bcd1b4e (diff)
downloadlinux-f2b1ce4949d6b52a9224118efb562a94e9b5d400.tar.xz
ASoC: twl4030: Convert to use devm_kzalloc
Allocate the private data with devm_kzalloc. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/codecs/twl4030.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index aa96788..d5e60d6 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -2237,7 +2237,8 @@ static int twl4030_soc_probe(struct snd_soc_codec *codec)
{
struct twl4030_priv *twl4030;
- twl4030 = kzalloc(sizeof(struct twl4030_priv), GFP_KERNEL);
+ twl4030 = devm_kzalloc(codec->dev, sizeof(struct twl4030_priv),
+ GFP_KERNEL);
if (twl4030 == NULL) {
dev_err(codec->dev, "Can not allocate memory\n");
return -ENOMEM;
@@ -2259,7 +2260,6 @@ static int twl4030_soc_remove(struct snd_soc_codec *codec)
/* Reset registers to their chip default before leaving */
twl4030_reset_registers(codec);
twl4030_set_bias_level(codec, SND_SOC_BIAS_OFF);
- kfree(twl4030);
if (pdata && pdata->hs_extmute && gpio_is_valid(pdata->hs_extmute_gpio))
gpio_free(pdata->hs_extmute_gpio);