regulator: core: Don't open code _regulator_is_enabled()
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 13 May 2012 23:40:14 +0000 (00:40 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 14 May 2012 14:25:19 +0000 (15:25 +0100)
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
drivers/regulator/core.c

index 5a33282..faa0532 100644 (file)
@@ -3160,8 +3160,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
                        goto scrub;
 
                /* Enable supply if rail is enabled */
-               if (rdev->desc->ops->is_enabled &&
-                               rdev->desc->ops->is_enabled(rdev)) {
+               if (_regulator_is_enabled(rdev)) {
                        ret = regulator_enable(rdev->supply);
                        if (ret < 0)
                                goto scrub;
@@ -3293,7 +3292,7 @@ int regulator_suspend_finish(void)
                                goto unlock;
                        if (!ops->disable)
                                goto unlock;
-                       if (ops->is_enabled && !ops->is_enabled(rdev))
+                       if (!_regulator_is_enabled(rdev))
                                goto unlock;
 
                        error = ops->disable(rdev);