]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/regulator/wm8400-regulator.c
Merge remote-tracking branch 'regulator/for-next'
[karo-tx-linux.git] / drivers / regulator / wm8400-regulator.c
index 58f51bec13f25d2f47a488ca53fc1099bb683762..82d82900085199f738d1555059d396315da6520a 100644 (file)
 #include <linux/mfd/wm8400-private.h>
 
 static const struct regulator_linear_range wm8400_ldo_ranges[] = {
-       { .min_uV =  900000, .max_uV = 1600000, .min_sel = 0, .max_sel = 14,
-         .uV_step =  50000 },
-       { .min_uV = 1700000, .max_uV = 3300000, .min_sel = 15, .max_sel = 31,
-         .uV_step = 100000 },
+       REGULATOR_LINEAR_RANGE(900000, 0, 14, 50000),
+       REGULATOR_LINEAR_RANGE(1700000, 15, 31, 100000),
 };
 
 static struct regulator_ops wm8400_ldo_ops = {
@@ -219,7 +217,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 +227,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,
 };
 
 /**