UPSTREAM: regulator: core: Log when we bring constraints into range
authorMark Brown <broonie@kernel.org>
Tue, 29 Mar 2016 23:33:42 +0000 (16:33 -0700)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 6 Mar 2017 10:28:40 +0000 (18:28 +0800)
This aids in debugging problems triggered by the regulator core applying
its constraints, we could potentially crash immediately after updating
the voltage if the constraints are buggy.

Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 45a91e8f767afbbffff46bf7251f81d15d121136)

Change-Id: I8c3e4a856f05c13e6ce3db8a6d46686557109962
Signed-off-by: David Wu <david.wu@rock-chips.com>
drivers/regulator/core.c

index 59778a4801c020fa8854943a0b4c11e0c6026d36..0d57cd6c3f24d05e8726aff30ef36d9c86bf1a71 100644 (file)
@@ -933,6 +933,8 @@ static int machine_constraints_voltage(struct regulator_dev *rdev,
                }
 
                if (target_min != current_uV || target_max != current_uV) {
+                       rdev_info(rdev, "Bringing %duV into %d-%duV\n",
+                                 current_uV, target_min, target_max);
                        ret = _regulator_do_set_voltage(
                                rdev, target_min, target_max);
                        if (ret < 0) {