summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm8996.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-27 19:59:23 +0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-27 20:04:08 +0400
commita290986b2a184941da60921ada71bcb47a0d4af2 (patch)
treeed89037c235194ca73e0771ee3789a459479ee8a /sound/soc/codecs/wm8996.c
parent897f7847e6fec6f24efef4268993afcfc36dca23 (diff)
downloadlinux-a290986b2a184941da60921ada71bcb47a0d4af2.tar.xz
ASoC: Convert wm8996 to use devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8996.c')
-rw-r--r--sound/soc/codecs/wm8996.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c
index 304a0e570cb4..41cc9d2d5ae9 100644
--- a/sound/soc/codecs/wm8996.c
+++ b/sound/soc/codecs/wm8996.c
@@ -3104,7 +3104,8 @@ static __devinit int wm8996_i2c_probe(struct i2c_client *i2c,
int ret, i;
unsigned int reg;
- wm8996 = kzalloc(sizeof(struct wm8996_priv), GFP_KERNEL);
+ wm8996 = devm_kzalloc(&i2c->dev, sizeof(struct wm8996_priv),
+ GFP_KERNEL);
if (wm8996 == NULL)
return -ENOMEM;
@@ -3216,7 +3217,6 @@ err_gpio:
if (wm8996->pdata.ldo_ena > 0)
gpio_free(wm8996->pdata.ldo_ena);
err:
- kfree(wm8996);
return ret;
}
@@ -3234,7 +3234,6 @@ static __devexit int wm8996_i2c_remove(struct i2c_client *client)
gpio_set_value_cansleep(wm8996->pdata.ldo_ena, 0);
gpio_free(wm8996->pdata.ldo_ena);
}
- kfree(wm8996);
return 0;
}