Skip to content

Commit

Permalink
regulator: core: Log when a device causes a voltage constraint fail
Browse files Browse the repository at this point in the history
Helps with figuring out when things went wrong.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Nov 28, 2012
1 parent 9489e9d commit dd8004a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,11 @@ static int regulator_check_consumers(struct regulator_dev *rdev,
*min_uV = regulator->min_uV;
}

if (*min_uV > *max_uV)
if (*min_uV > *max_uV) {
dev_err(regulator->dev, "Restricting voltage, %u-%uuV\n",
regulator->min_uV, regulator->max_uV);
return -EINVAL;
}

return 0;
}
Expand Down

0 comments on commit dd8004a

Please sign in to comment.