diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-12-29 12:12:29 +0800 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-01-02 12:28:13 +0000 |
commit | 6945e9f9dfee897891a8ac620ce1621a2daf7e02 (patch) | |
tree | 4399c0777719421028f2fe0ef58abd718463ef54 /sound | |
parent | a54877d7456ffa88c95d7eb587971792cb1892d6 (diff) |
ASoC: Convert tpa6130a2 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/tpa6130a2.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c index 7eeca79d7387..363b99dad8e9 100644 --- a/sound/soc/codecs/tpa6130a2.c +++ b/sound/soc/codecs/tpa6130a2.c @@ -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 @@ err_regulator: 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; |