aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/tpa6130a2.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-12-28 23:12:29 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-01-02 07:28:13 -0500
commit6945e9f9dfee897891a8ac620ce1621a2daf7e02 (patch)
tree4399c0777719421028f2fe0ef58abd718463ef54 /sound/soc/codecs/tpa6130a2.c
parenta54877d7456ffa88c95d7eb587971792cb1892d6 (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/soc/codecs/tpa6130a2.c')
-rw-r--r--sound/soc/codecs/tpa6130a2.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c
index 7eeca79d738..363b99dad8e 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,
376 return -ENODEV; 376 return -ENODEV;
377 } 377 }
378 378
379 data = kzalloc(sizeof(*data), GFP_KERNEL); 379 data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL);
380 if (data == NULL) { 380 if (data == NULL) {
381 dev_err(dev, "Can not allocate memory\n"); 381 dev_err(dev, "Can not allocate memory\n");
382 return -ENOMEM; 382 return -ENOMEM;
@@ -450,7 +450,6 @@ err_regulator:
450 if (data->power_gpio >= 0) 450 if (data->power_gpio >= 0)
451 gpio_free(data->power_gpio); 451 gpio_free(data->power_gpio);
452err_gpio: 452err_gpio:
453 kfree(data);
454 tpa6130a2_client = NULL; 453 tpa6130a2_client = NULL;
455 454
456 return ret; 455 return ret;
@@ -466,8 +465,6 @@ static int __devexit tpa6130a2_remove(struct i2c_client *client)
466 gpio_free(data->power_gpio); 465 gpio_free(data->power_gpio);
467 466
468 regulator_put(data->supply); 467 regulator_put(data->supply);
469
470 kfree(data);
471 tpa6130a2_client = NULL; 468 tpa6130a2_client = NULL;
472 469
473 return 0; 470 return 0;