diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-09-29 20:50:14 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-30 13:10:52 -0400 |
commit | fda5842cc62c36c5ed02b763f6045e720582b083 (patch) | |
tree | cadb22caa5f81d0f36fe7aaf779ef955fb0bbfa3 | |
parent | 0cdfcc0f9352a4c076fbb51299e2b12a35619a51 (diff) |
regulator: ab3100: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/regulator/ab3100.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/regulator/ab3100.c b/drivers/regulator/ab3100.c index 7d5eaa874b2d..77b46d0b37a6 100644 --- a/drivers/regulator/ab3100.c +++ b/drivers/regulator/ab3100.c | |||
@@ -535,7 +535,7 @@ static int ab3100_regulator_register(struct platform_device *pdev, | |||
535 | config.dev = &pdev->dev; | 535 | config.dev = &pdev->dev; |
536 | config.driver_data = reg; | 536 | config.driver_data = reg; |
537 | 537 | ||
538 | rdev = regulator_register(desc, &config); | 538 | rdev = devm_regulator_register(&pdev->dev, desc, &config); |
539 | if (IS_ERR(rdev)) { | 539 | if (IS_ERR(rdev)) { |
540 | err = PTR_ERR(rdev); | 540 | err = PTR_ERR(rdev); |
541 | dev_err(&pdev->dev, | 541 | dev_err(&pdev->dev, |
@@ -616,7 +616,6 @@ static int ab3100_regulators_remove(struct platform_device *pdev) | |||
616 | for (i = 0; i < AB3100_NUM_REGULATORS; i++) { | 616 | for (i = 0; i < AB3100_NUM_REGULATORS; i++) { |
617 | struct ab3100_regulator *reg = &ab3100_regulators[i]; | 617 | struct ab3100_regulator *reg = &ab3100_regulators[i]; |
618 | 618 | ||
619 | regulator_unregister(reg->rdev); | ||
620 | reg->rdev = NULL; | 619 | reg->rdev = NULL; |
621 | } | 620 | } |
622 | return 0; | 621 | return 0; |