Commit 4273fcfd authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

ASoC: Convert ak4641 to devm_kzalloc()

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 7246492d
...@@ -602,7 +602,8 @@ static int __devinit ak4641_i2c_probe(struct i2c_client *i2c, ...@@ -602,7 +602,8 @@ static int __devinit ak4641_i2c_probe(struct i2c_client *i2c,
struct ak4641_priv *ak4641; struct ak4641_priv *ak4641;
int ret; int ret;
ak4641 = kzalloc(sizeof(struct ak4641_priv), GFP_KERNEL); ak4641 = devm_kzalloc(&i2c->dev, sizeof(struct ak4641_priv),
GFP_KERNEL);
if (!ak4641) if (!ak4641)
return -ENOMEM; return -ENOMEM;
...@@ -610,16 +611,12 @@ static int __devinit ak4641_i2c_probe(struct i2c_client *i2c, ...@@ -610,16 +611,12 @@ static int __devinit ak4641_i2c_probe(struct i2c_client *i2c,
ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_ak4641, ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_ak4641,
ak4641_dai, ARRAY_SIZE(ak4641_dai)); ak4641_dai, ARRAY_SIZE(ak4641_dai));
if (ret < 0)
kfree(ak4641);
return ret; return ret;
} }
static int __devexit ak4641_i2c_remove(struct i2c_client *i2c) static int __devexit ak4641_i2c_remove(struct i2c_client *i2c)
{ {
snd_soc_unregister_codec(&i2c->dev); snd_soc_unregister_codec(&i2c->dev);
kfree(i2c_get_clientdata(i2c));
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