]> git.karo-electronics.de Git - linux-beck.git/commitdiff
regulator: wm8400: Convert to devm_regulator_register()
authorMark Brown <broonie@linaro.org>
Sat, 31 Aug 2013 11:00:57 +0000 (12:00 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 16 Sep 2013 23:27:55 +0000 (00:27 +0100)
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/wm8400-regulator.c

index 58f51bec13f25d2f47a488ca53fc1099bb683762..870b52f709bcf411244adeb77ef241049cdf117c 100644 (file)
@@ -219,7 +219,8 @@ static int wm8400_regulator_probe(struct platform_device *pdev)
        config.driver_data = wm8400;
        config.regmap = wm8400->regmap;
 
-       rdev = regulator_register(&regulators[pdev->id], &config);
+       rdev = devm_regulator_register(&pdev->dev, &regulators[pdev->id],
+                                      &config);
        if (IS_ERR(rdev))
                return PTR_ERR(rdev);
 
@@ -228,21 +229,11 @@ static int wm8400_regulator_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int wm8400_regulator_remove(struct platform_device *pdev)
-{
-       struct regulator_dev *rdev = platform_get_drvdata(pdev);
-
-       regulator_unregister(rdev);
-
-       return 0;
-}
-
 static struct platform_driver wm8400_regulator_driver = {
        .driver = {
                .name = "wm8400-regulator",
        },
        .probe = wm8400_regulator_probe,
-       .remove = wm8400_regulator_remove,
 };
 
 /**