summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm9090.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-03 02:09:47 +0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-04 01:35:09 +0400
commit455b91bfe86fd4773a15593eb7a834b9f552797d (patch)
tree68bb8b9005fbc44a87bedc114004f0f7eea04685 /sound/soc/codecs/wm9090.c
parent2edaed82b70c22b63bb918e1ca9c34876da21320 (diff)
downloadlinux-455b91bfe86fd4773a15593eb7a834b9f552797d.tar.xz
ASoC: Convert WM9090 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm9090.c')
-rw-r--r--sound/soc/codecs/wm9090.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm9090.c b/sound/soc/codecs/wm9090.c
index 31869afa7007..d1d2c703eab2 100644
--- a/sound/soc/codecs/wm9090.c
+++ b/sound/soc/codecs/wm9090.c
@@ -647,7 +647,7 @@ static int wm9090_i2c_probe(struct i2c_client *i2c,
struct wm9090_priv *wm9090;
int ret;
- wm9090 = kzalloc(sizeof(*wm9090), GFP_KERNEL);
+ wm9090 = devm_kzalloc(&i2c->dev, sizeof(*wm9090), GFP_KERNEL);
if (wm9090 == NULL) {
dev_err(&i2c->dev, "Can not allocate memory\n");
return -ENOMEM;
@@ -661,8 +661,6 @@ static int wm9090_i2c_probe(struct i2c_client *i2c,
ret = snd_soc_register_codec(&i2c->dev,
&soc_codec_dev_wm9090, NULL, 0);
- if (ret < 0)
- kfree(wm9090);
return ret;
}
@@ -671,7 +669,6 @@ static int __devexit wm9090_i2c_remove(struct i2c_client *i2c)
struct wm9090_priv *wm9090 = i2c_get_clientdata(i2c);
snd_soc_unregister_codec(&i2c->dev);
- kfree(wm9090);
return 0;
}