diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-04-11 10:40:18 +0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-11 13:16:50 +0400 |
commit | 9eb0c4218aa444f863e7f54909351d5b4f0fac06 (patch) | |
tree | bcb7413f475d7e67d93d3bb1826f2eb3ef7479b1 /drivers/regulator/tps6507x-regulator.c | |
parent | d914d81b74fd4e91aed334c3f664be4b94364ee8 (diff) | |
download | linux-9eb0c4218aa444f863e7f54909351d5b4f0fac06.tar.xz |
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) if (!init_data) return -EINVAL; - tps = kzalloc(sizeof(*tps), GFP_KERNEL); + tps = devm_kzalloc(&pdev->dev, sizeof(*tps), GFP_KERNEL); if (!tps) return -ENOMEM; @@ -479,8 +479,6 @@ static __devinit int tps6507x_pmic_probe(struct platform_device *pdev) fail: while (--i >= 0) regulator_unregister(tps->rdev[i]); - - kfree(tps); return error; } @@ -492,9 +490,6 @@ static int __devexit tps6507x_pmic_remove(struct platform_device *pdev) for (i = 0; i < TPS6507X_NUM_REGULATOR; i++) regulator_unregister(tps->rdev[i]); - - kfree(tps); - return 0; } |