From 9eb0c4218aa444f863e7f54909351d5b4f0fac06 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Wed, 11 Apr 2012 14:40:18 +0800 Subject: regulator: Convert tps65xxx regulator drivers to use devm_kzalloc Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- drivers/regulator/tps65912-regulator.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'drivers/regulator/tps65912-regulator.c') 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) reg_data = pmic_plat_data->tps65912_pmic_init_data; - pmic = kzalloc(sizeof(*pmic), GFP_KERNEL); + pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL); if (!pmic) return -ENOMEM; @@ -523,8 +523,6 @@ static __devinit int tps65912_probe(struct platform_device *pdev) err: while (--i >= 0) regulator_unregister(pmic->rdev[i]); - - kfree(pmic); return err; } @@ -535,8 +533,6 @@ static int __devexit tps65912_remove(struct platform_device *pdev) for (i = 0; i < TPS65912_NUM_REGULATOR; i++) regulator_unregister(tps65912_reg->rdev[i]); - - kfree(tps65912_reg); return 0; } -- cgit v1.2.3