Skip to content

Commit

Permalink
regulator: print state at boot
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
osctobe authored and broonie committed Sep 28, 2020
1 parent 8d23b0b commit 99ad5f6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 99ad5f6

Please sign in to comment.