Commit eb3bb97c authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

ASoC: Convert lm4857 to devm_kzalloc()

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 306bf6b1
...@@ -215,7 +215,7 @@ static int __devinit lm4857_i2c_probe(struct i2c_client *i2c, ...@@ -215,7 +215,7 @@ static int __devinit lm4857_i2c_probe(struct i2c_client *i2c,
struct lm4857 *lm4857; struct lm4857 *lm4857;
int ret; int ret;
lm4857 = kzalloc(sizeof(*lm4857), GFP_KERNEL); lm4857 = devm_kzalloc(&i2c->dev, sizeof(*lm4857), GFP_KERNEL);
if (!lm4857) if (!lm4857)
return -ENOMEM; return -ENOMEM;
...@@ -225,21 +225,12 @@ static int __devinit lm4857_i2c_probe(struct i2c_client *i2c, ...@@ -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); ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_lm4857, NULL, 0);
if (ret) { return ret;
kfree(lm4857);
return ret;
}
return 0;
} }
static int __devexit lm4857_i2c_remove(struct i2c_client *i2c) static int __devexit lm4857_i2c_remove(struct i2c_client *i2c)
{ {
struct lm4857 *lm4857 = i2c_get_clientdata(i2c);
snd_soc_unregister_codec(&i2c->dev); snd_soc_unregister_codec(&i2c->dev);
kfree(lm4857);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment