aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2012-09-10 06:46:30 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-22 11:18:32 -0400
commitf2b1ce4949d6b52a9224118efb562a94e9b5d400 (patch)
tree116c2f3fe893f82c42b0b32f085c622f4b5636bf /sound
parentd0b3847b40f8da4b90b22db0f3678ba68bcd1b4e (diff)
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>
Diffstat (limited to 'sound')
-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 aa96788c8673..d5e60d639ee8 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)
2237{ 2237{
2238 struct twl4030_priv *twl4030; 2238 struct twl4030_priv *twl4030;
2239 2239
2240 twl4030 = kzalloc(sizeof(struct twl4030_priv), GFP_KERNEL); 2240 twl4030 = devm_kzalloc(codec->dev, sizeof(struct twl4030_priv),
2241 GFP_KERNEL);
2241 if (twl4030 == NULL) { 2242 if (twl4030 == NULL) {
2242 dev_err(codec->dev, "Can not allocate memory\n"); 2243 dev_err(codec->dev, "Can not allocate memory\n");
2243 return -ENOMEM; 2244 return -ENOMEM;
@@ -2259,7 +2260,6 @@ static int twl4030_soc_remove(struct snd_soc_codec *codec)
2259 /* Reset registers to their chip default before leaving */ 2260 /* Reset registers to their chip default before leaving */
2260 twl4030_reset_registers(codec); 2261 twl4030_reset_registers(codec);
2261 twl4030_set_bias_level(codec, SND_SOC_BIAS_OFF); 2262 twl4030_set_bias_level(codec, SND_SOC_BIAS_OFF);
2262 kfree(twl4030);
2263 2263
2264 if (pdata && pdata->hs_extmute && gpio_is_valid(pdata->hs_extmute_gpio)) 2264 if (pdata && pdata->hs_extmute && gpio_is_valid(pdata->hs_extmute_gpio))
2265 gpio_free(pdata->hs_extmute_gpio); 2265 gpio_free(pdata->hs_extmute_gpio);