diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-04-11 02:40:18 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-11 05:16:50 -0400 |
commit | 9eb0c4218aa444f863e7f54909351d5b4f0fac06 (patch) | |
tree | bcb7413f475d7e67d93d3bb1826f2eb3ef7479b1 /drivers/regulator/tps65912-regulator.c | |
parent | d914d81b74fd4e91aed334c3f664be4b94364ee8 (diff) |
regulator: Convert tps65xxx regulator drivers to use devm_kzalloc
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/tps65912-regulator.c')
-rw-r--r-- | drivers/regulator/tps65912-regulator.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/regulator/tps65912-regulator.c b/drivers/regulator/tps65912-regulator.c index 8c9c61383fee..af335dd35903 100644 --- a/drivers/regulator/tps65912-regulator.c +++ b/drivers/regulator/tps65912-regulator.c | |||
@@ -477,7 +477,7 @@ static __devinit int tps65912_probe(struct platform_device *pdev) | |||
477 | 477 | ||
478 | reg_data = pmic_plat_data->tps65912_pmic_init_data; | 478 | reg_data = pmic_plat_data->tps65912_pmic_init_data; |
479 | 479 | ||
480 | pmic = kzalloc(sizeof(*pmic), GFP_KERNEL); | 480 | pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL); |
481 | if (!pmic) | 481 | if (!pmic) |
482 | return -ENOMEM; | 482 | return -ENOMEM; |
483 | 483 | ||
@@ -523,8 +523,6 @@ static __devinit int tps65912_probe(struct platform_device *pdev) | |||
523 | err: | 523 | err: |
524 | while (--i >= 0) | 524 | while (--i >= 0) |
525 | regulator_unregister(pmic->rdev[i]); | 525 | regulator_unregister(pmic->rdev[i]); |
526 | |||
527 | kfree(pmic); | ||
528 | return err; | 526 | return err; |
529 | } | 527 | } |
530 | 528 | ||
@@ -535,8 +533,6 @@ static int __devexit tps65912_remove(struct platform_device *pdev) | |||
535 | 533 | ||
536 | for (i = 0; i < TPS65912_NUM_REGULATOR; i++) | 534 | for (i = 0; i < TPS65912_NUM_REGULATOR; i++) |
537 | regulator_unregister(tps65912_reg->rdev[i]); | 535 | regulator_unregister(tps65912_reg->rdev[i]); |
538 | |||
539 | kfree(tps65912_reg); | ||
540 | return 0; | 536 | return 0; |
541 | } | 537 | } |
542 | 538 | ||