aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-04-05 00:08:58 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-05 05:48:16 -0400
commit7eb6444fc33bfe7bcd05533de86a1dc4e1852d71 (patch)
tree83bce62e2199d5464f4817349e58720570a923e9
parenta69df8a14ae7b891ee22f0e4c081f3ff65c0640f (diff)
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>
-rw-r--r--drivers/regulator/da9052-regulator.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c
index 7eb7293bcd12..83e489f76a90 100644
--- a/drivers/regulator/da9052-regulator.c
+++ b/drivers/regulator/da9052-regulator.c
@@ -406,7 +406,6 @@ static int __devinit da9052_regulator_probe(struct platform_device *pdev)
406 struct da9052_regulator *regulator; 406 struct da9052_regulator *regulator;
407 struct da9052 *da9052; 407 struct da9052 *da9052;
408 struct da9052_pdata *pdata; 408 struct da9052_pdata *pdata;
409 int ret;
410 409
411 regulator = devm_kzalloc(&pdev->dev, sizeof(struct da9052_regulator), 410 regulator = devm_kzalloc(&pdev->dev, sizeof(struct da9052_regulator),
412 GFP_KERNEL); 411 GFP_KERNEL);
@@ -421,8 +420,7 @@ static int __devinit da9052_regulator_probe(struct platform_device *pdev)
421 pdev->id); 420 pdev->id);
422 if (regulator->info == NULL) { 421 if (regulator->info == NULL) {
423 dev_err(&pdev->dev, "invalid regulator ID specified\n"); 422 dev_err(&pdev->dev, "invalid regulator ID specified\n");
424 ret = -EINVAL; 423 return -EINVAL;
425 goto err;
426 } 424 }
427 regulator->rdev = regulator_register(&regulator->info->reg_desc, 425 regulator->rdev = regulator_register(&regulator->info->reg_desc,
428 &pdev->dev, 426 &pdev->dev,
@@ -431,16 +429,12 @@ static int __devinit da9052_regulator_probe(struct platform_device *pdev)
431 if (IS_ERR(regulator->rdev)) { 429 if (IS_ERR(regulator->rdev)) {
432 dev_err(&pdev->dev, "failed to register regulator %s\n", 430 dev_err(&pdev->dev, "failed to register regulator %s\n",
433 regulator->info->reg_desc.name); 431 regulator->info->reg_desc.name);
434 ret = PTR_ERR(regulator->rdev); 432 return PTR_ERR(regulator->rdev);
435 goto err;
436 } 433 }
437 434
438 platform_set_drvdata(pdev, regulator); 435 platform_set_drvdata(pdev, regulator);
439 436
440 return 0; 437 return 0;
441err:
442 devm_kfree(&pdev->dev, regulator);
443 return ret;
444} 438}
445 439
446static int __devexit da9052_regulator_remove(struct platform_device *pdev) 440static int __devexit da9052_regulator_remove(struct platform_device *pdev)
@@ -448,8 +442,6 @@ static int __devexit da9052_regulator_remove(struct platform_device *pdev)
448 struct da9052_regulator *regulator = platform_get_drvdata(pdev); 442 struct da9052_regulator *regulator = platform_get_drvdata(pdev);
449 443
450 regulator_unregister(regulator->rdev); 444 regulator_unregister(regulator->rdev);
451 devm_kfree(&pdev->dev, regulator);
452
453 return 0; 445 return 0;
454} 446}
455 447