diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-12-26 20:56:25 +0800 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-27 12:58:02 +0000 |
commit | eb3bb97ce73ac666d9c3d16fc250fa0b78e3b8f2 (patch) | |
tree | 1b256f7ffa1d5f9eca811ec88761c7ce77c924e5 /sound/soc/codecs/lm4857.c | |
parent | 306bf6b19ee3da824fbdbdb2dc4e5d62a8983a2c (diff) |
ASoC: Convert lm4857 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/lm4857.c')
-rw-r--r-- | sound/soc/codecs/lm4857.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/sound/soc/codecs/lm4857.c b/sound/soc/codecs/lm4857.c index c387dafc6ab..319039240e0 100644 --- a/sound/soc/codecs/lm4857.c +++ b/sound/soc/codecs/lm4857.c @@ -215,7 +215,7 @@ static int __devinit lm4857_i2c_probe(struct i2c_client *i2c, struct lm4857 *lm4857; int ret; - lm4857 = kzalloc(sizeof(*lm4857), GFP_KERNEL); + lm4857 = devm_kzalloc(&i2c->dev, sizeof(*lm4857), GFP_KERNEL); if (!lm4857) return -ENOMEM; @@ -225,21 +225,12 @@ static int __devinit lm4857_i2c_probe(struct i2c_client *i2c, ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_lm4857, NULL, 0); - if (ret) { - kfree(lm4857); - return ret; - } - - return 0; + return ret; } static int __devexit lm4857_i2c_remove(struct i2c_client *i2c) { - struct lm4857 *lm4857 = i2c_get_clientdata(i2c); - snd_soc_unregister_codec(&i2c->dev); - kfree(lm4857); - return 0; } |