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/tps6507x-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/tps6507x-regulator.c')
-rw-r--r-- | drivers/regulator/tps6507x-regulator.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/regulator/tps6507x-regulator.c b/drivers/regulator/tps6507x-regulator.c index 16d27fc2c7f7..8e432004b949 100644 --- a/drivers/regulator/tps6507x-regulator.c +++ b/drivers/regulator/tps6507x-regulator.c | |||
@@ -429,7 +429,7 @@ static __devinit int tps6507x_pmic_probe(struct platform_device *pdev) | |||
429 | if (!init_data) | 429 | if (!init_data) |
430 | return -EINVAL; | 430 | return -EINVAL; |
431 | 431 | ||
432 | tps = kzalloc(sizeof(*tps), GFP_KERNEL); | 432 | tps = devm_kzalloc(&pdev->dev, sizeof(*tps), GFP_KERNEL); |
433 | if (!tps) | 433 | if (!tps) |
434 | return -ENOMEM; | 434 | return -ENOMEM; |
435 | 435 | ||
@@ -479,8 +479,6 @@ static __devinit int tps6507x_pmic_probe(struct platform_device *pdev) | |||
479 | fail: | 479 | fail: |
480 | while (--i >= 0) | 480 | while (--i >= 0) |
481 | regulator_unregister(tps->rdev[i]); | 481 | regulator_unregister(tps->rdev[i]); |
482 | |||
483 | kfree(tps); | ||
484 | return error; | 482 | return error; |
485 | } | 483 | } |
486 | 484 | ||
@@ -492,9 +490,6 @@ static int __devexit tps6507x_pmic_remove(struct platform_device *pdev) | |||
492 | 490 | ||
493 | for (i = 0; i < TPS6507X_NUM_REGULATOR; i++) | 491 | for (i = 0; i < TPS6507X_NUM_REGULATOR; i++) |
494 | regulator_unregister(tps->rdev[i]); | 492 | regulator_unregister(tps->rdev[i]); |
495 | |||
496 | kfree(tps); | ||
497 | |||
498 | return 0; | 493 | return 0; |
499 | } | 494 | } |
500 | 495 | ||