Commit 80c2f9da authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

ASoC: Convert adau1373 to devm_kzalloc()

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 30c88f2c
...@@ -1360,7 +1360,7 @@ static int __devinit adau1373_i2c_probe(struct i2c_client *client, ...@@ -1360,7 +1360,7 @@ static int __devinit adau1373_i2c_probe(struct i2c_client *client,
struct adau1373 *adau1373; struct adau1373 *adau1373;
int ret; int ret;
adau1373 = kzalloc(sizeof(*adau1373), GFP_KERNEL); adau1373 = devm_kzalloc(&client->dev, sizeof(*adau1373), GFP_KERNEL);
if (!adau1373) if (!adau1373)
return -ENOMEM; return -ENOMEM;
...@@ -1368,16 +1368,12 @@ static int __devinit adau1373_i2c_probe(struct i2c_client *client, ...@@ -1368,16 +1368,12 @@ static int __devinit adau1373_i2c_probe(struct i2c_client *client,
ret = snd_soc_register_codec(&client->dev, &adau1373_codec_driver, ret = snd_soc_register_codec(&client->dev, &adau1373_codec_driver,
adau1373_dai_driver, ARRAY_SIZE(adau1373_dai_driver)); adau1373_dai_driver, ARRAY_SIZE(adau1373_dai_driver));
if (ret < 0)
kfree(adau1373);
return ret; return ret;
} }
static int __devexit adau1373_i2c_remove(struct i2c_client *client) static int __devexit adau1373_i2c_remove(struct i2c_client *client)
{ {
snd_soc_unregister_codec(&client->dev); snd_soc_unregister_codec(&client->dev);
kfree(dev_get_drvdata(&client->dev));
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