Commit 6945e9f9 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

ASoC: Convert tpa6130a2 to devm_kzalloc()

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent a54877d7
......@@ -376,7 +376,7 @@ static int __devinit tpa6130a2_probe(struct i2c_client *client,
return -ENODEV;
}
data = kzalloc(sizeof(*data), GFP_KERNEL);
data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL);
if (data == NULL) {
dev_err(dev, "Can not allocate memory\n");
return -ENOMEM;
......@@ -450,7 +450,6 @@ static int __devinit tpa6130a2_probe(struct i2c_client *client,
if (data->power_gpio >= 0)
gpio_free(data->power_gpio);
err_gpio:
kfree(data);
tpa6130a2_client = NULL;
return ret;
......@@ -466,8 +465,6 @@ static int __devexit tpa6130a2_remove(struct i2c_client *client)
gpio_free(data->power_gpio);
regulator_put(data->supply);
kfree(data);
tpa6130a2_client = NULL;
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