1
0
Fork 0

regulator: da9052: Remove unneeded devm_kfree calls

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
wifi-calibration
Axel Lin 2012-04-05 12:08:58 +08:00 committed by Mark Brown
parent a69df8a14a
commit 7eb6444fc3
1 changed files with 2 additions and 10 deletions

View File

@ -406,7 +406,6 @@ static int __devinit da9052_regulator_probe(struct platform_device *pdev)
struct da9052_regulator *regulator; struct da9052_regulator *regulator;
struct da9052 *da9052; struct da9052 *da9052;
struct da9052_pdata *pdata; struct da9052_pdata *pdata;
int ret;
regulator = devm_kzalloc(&pdev->dev, sizeof(struct da9052_regulator), regulator = devm_kzalloc(&pdev->dev, sizeof(struct da9052_regulator),
GFP_KERNEL); GFP_KERNEL);
@ -421,8 +420,7 @@ static int __devinit da9052_regulator_probe(struct platform_device *pdev)
pdev->id); pdev->id);
if (regulator->info == NULL) { if (regulator->info == NULL) {
dev_err(&pdev->dev, "invalid regulator ID specified\n"); dev_err(&pdev->dev, "invalid regulator ID specified\n");
ret = -EINVAL; return -EINVAL;
goto err;
} }
regulator->rdev = regulator_register(&regulator->info->reg_desc, regulator->rdev = regulator_register(&regulator->info->reg_desc,
&pdev->dev, &pdev->dev,
@ -431,16 +429,12 @@ static int __devinit da9052_regulator_probe(struct platform_device *pdev)
if (IS_ERR(regulator->rdev)) { if (IS_ERR(regulator->rdev)) {
dev_err(&pdev->dev, "failed to register regulator %s\n", dev_err(&pdev->dev, "failed to register regulator %s\n",
regulator->info->reg_desc.name); regulator->info->reg_desc.name);
ret = PTR_ERR(regulator->rdev); return PTR_ERR(regulator->rdev);
goto err;
} }
platform_set_drvdata(pdev, regulator); platform_set_drvdata(pdev, regulator);
return 0; return 0;
err:
devm_kfree(&pdev->dev, regulator);
return ret;
} }
static int __devexit da9052_regulator_remove(struct platform_device *pdev) static int __devexit da9052_regulator_remove(struct platform_device *pdev)
@ -448,8 +442,6 @@ static int __devexit da9052_regulator_remove(struct platform_device *pdev)
struct da9052_regulator *regulator = platform_get_drvdata(pdev); struct da9052_regulator *regulator = platform_get_drvdata(pdev);
regulator_unregister(regulator->rdev); regulator_unregister(regulator->rdev);
devm_kfree(&pdev->dev, regulator);
return 0; return 0;
} }