aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2020-09-26 23:32:40 +0200
committerMark Brown <broonie@kernel.org>2020-09-28 19:03:15 +0100
commit99ad5f6ec0cd776e34295ec9fc82bfb004c3fad5 (patch)
tree074b3a41999e11aab4c661bf814c4e9bfdb80baf /drivers/regulator
parentregulator: s5m8767: initialize driver via module_platform_driver (diff)
downloadlinux-dev-99ad5f6ec0cd776e34295ec9fc82bfb004c3fad5.tar.xz
linux-dev-99ad5f6ec0cd776e34295ec9fc82bfb004c3fad5.zip
regulator: print state at boot
Make the initial state of the regulator shown when debugging. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Link: https://lore.kernel.org/r/53c4f3d394d68f0989174f89e3b0882cebbbd787.1601155770.git.mirq-linux@rere.qmqm.pl Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/core.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 6ef99df1a7d2..42cffbe84080 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1111,10 +1111,15 @@ static void print_constraints(struct regulator_dev *rdev)
if (constraints->valid_modes_mask & REGULATOR_MODE_IDLE)
count += scnprintf(buf + count, len - count, "idle ");
if (constraints->valid_modes_mask & REGULATOR_MODE_STANDBY)
- count += scnprintf(buf + count, len - count, "standby");
+ count += scnprintf(buf + count, len - count, "standby ");
if (!count)
- scnprintf(buf, len, "no parameters");
+ count = scnprintf(buf, len, "no parameters");
+ else
+ --count;
+
+ count += scnprintf(buf + count, len - count, ", %s",
+ _regulator_is_enabled(rdev) ? "enabled" : "disabled");
rdev_dbg(rdev, "%s\n", buf);