Commit 0d3288063b4e45335ea011b89d0850a0fd76096c

Authored by Axel Lin
Committed by Mark Brown
1 parent ea49a5ebbb

regulator: da9055: Convert to devm_regulator_register

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>

Showing 1 changed file with 5 additions and 19 deletions Side-by-side Diff

drivers/regulator/da9055-regulator.c
... ... @@ -564,13 +564,13 @@
564 564 if (ret < 0)
565 565 return ret;
566 566  
567   - regulator->rdev = regulator_register(&regulator->info->reg_desc,
568   - &config);
  567 + regulator->rdev = devm_regulator_register(&pdev->dev,
  568 + &regulator->info->reg_desc,
  569 + &config);
569 570 if (IS_ERR(regulator->rdev)) {
570 571 dev_err(&pdev->dev, "Failed to register regulator %s\n",
571 572 regulator->info->reg_desc.name);
572   - ret = PTR_ERR(regulator->rdev);
573   - return ret;
  573 + return PTR_ERR(regulator->rdev);
574 574 }
575 575  
576 576 /* Only LDO 5 and 6 has got the over current interrupt */
... ... @@ -588,7 +588,7 @@
588 588 dev_err(&pdev->dev,
589 589 "Failed to request Regulator IRQ %d: %d\n",
590 590 irq, ret);
591   - goto err_regulator;
  591 + return ret;
592 592 }
593 593 }
594 594 }
595 595  
596 596  
... ... @@ -596,24 +596,10 @@
596 596 platform_set_drvdata(pdev, regulator);
597 597  
598 598 return 0;
599   -
600   -err_regulator:
601   - regulator_unregister(regulator->rdev);
602   - return ret;
603 599 }
604 600  
605   -static int da9055_regulator_remove(struct platform_device *pdev)
606   -{
607   - struct da9055_regulator *regulator = platform_get_drvdata(pdev);
608   -
609   - regulator_unregister(regulator->rdev);
610   -
611   - return 0;
612   -}
613   -
614 601 static struct platform_driver da9055_regulator_driver = {
615 602 .probe = da9055_regulator_probe,
616   - .remove = da9055_regulator_remove,
617 603 .driver = {
618 604 .name = "da9055-regulator",
619 605 .owner = THIS_MODULE,