From fbb4d2d856d222f4c38a5f1a7b985e7ee03a5413 Mon Sep 17 00:00:00 2001 From: David Collins Date: Fri, 13 Sep 2013 16:13:59 -0700 Subject: [PATCH] ANDROID: GKI: Revert "regulator: Enable supply regulator if child rail is enabled." This reverts commit b2296bd43e78 ("regulator: Enable supply regulator if child rail is enabled."). The change results in the following incorrect behavior. If a given regulator has a parent supply and the regulator is enabled either before or during regulator_register(), then regulator_enable() is called on the supply. Unfortunately, there is no matching regulator_disable() call. This means that the parent supply will stay enabled forever even if the child is disabled later. The stated goal of the change was to enable the parent of a regulator which was enabled based on its machine constraints. However, the only constraints that leads to enable() being called for a regulator are boot-on or always-on. If these have been specified for a child regulator then they should have also been specified for its parent regulator. Therefore, there should be no need to explicitly enable the parent when the child is registered. Bug: 150508586 Change-Id: Ib8e6db65dcd44c27ef99509ff0cfd2f8e16e9f65 Signed-off-by: David Collins (cherry picked from commit 7a88f5efeab2059093e2398d57d6cd36220b6bc5) Signed-off-by: Saravana Kannan --- drivers/regulator/core.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 3ec37a92fb47..17966a1f7732 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1666,16 +1666,6 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) return ret; } - /* Cascade always-on state to supply */ - if (_regulator_is_enabled(rdev)) { - ret = regulator_enable(rdev->supply); - if (ret < 0) { - _regulator_put(rdev->supply); - rdev->supply = NULL; - return ret; - } - } - return 0; }