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

ASoC: Convert tlv320aic23 to devm_kzalloc()

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent d999c021
...@@ -634,7 +634,7 @@ static int tlv320aic23_codec_probe(struct i2c_client *i2c, ...@@ -634,7 +634,7 @@ static int tlv320aic23_codec_probe(struct i2c_client *i2c,
if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
return -EINVAL; return -EINVAL;
aic23 = kzalloc(sizeof(struct aic23), GFP_KERNEL); aic23 = devm_kzalloc(&i2c->dev, sizeof(struct aic23), GFP_KERNEL);
if (aic23 == NULL) if (aic23 == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -643,14 +643,11 @@ static int tlv320aic23_codec_probe(struct i2c_client *i2c, ...@@ -643,14 +643,11 @@ static int tlv320aic23_codec_probe(struct i2c_client *i2c,
ret = snd_soc_register_codec(&i2c->dev, ret = snd_soc_register_codec(&i2c->dev,
&soc_codec_dev_tlv320aic23, &tlv320aic23_dai, 1); &soc_codec_dev_tlv320aic23, &tlv320aic23_dai, 1);
if (ret < 0)
kfree(aic23);
return ret; return ret;
} }
static int __exit tlv320aic23_i2c_remove(struct i2c_client *i2c) static int __exit tlv320aic23_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