Commit 89f425ed authored by Mark Brown's avatar Mark Brown Committed by Liam Girdwood

regulator: Make core more chatty about some errors

Prevent some head scratching by making the core log about some rare but
possible errors with invalid voltage ranges and modes being set.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 39aa9b6e
...@@ -151,8 +151,11 @@ static int regulator_check_voltage(struct regulator_dev *rdev, ...@@ -151,8 +151,11 @@ static int regulator_check_voltage(struct regulator_dev *rdev,
if (*min_uV < rdev->constraints->min_uV) if (*min_uV < rdev->constraints->min_uV)
*min_uV = rdev->constraints->min_uV; *min_uV = rdev->constraints->min_uV;
if (*min_uV > *max_uV) if (*min_uV > *max_uV) {
rdev_err(rdev, "unsupportable voltage range: %d-%duV\n",
min_uV, max_uV);
return -EINVAL; return -EINVAL;
}
return 0; return 0;
} }
...@@ -205,8 +208,11 @@ static int regulator_check_current_limit(struct regulator_dev *rdev, ...@@ -205,8 +208,11 @@ static int regulator_check_current_limit(struct regulator_dev *rdev,
if (*min_uA < rdev->constraints->min_uA) if (*min_uA < rdev->constraints->min_uA)
*min_uA = rdev->constraints->min_uA; *min_uA = rdev->constraints->min_uA;
if (*min_uA > *max_uA) if (*min_uA > *max_uA) {
rdev_err(rdev, "unsupportable current range: %d-%duA\n",
min_uA, max_uA);
return -EINVAL; return -EINVAL;
}
return 0; return 0;
} }
...@@ -221,6 +227,7 @@ static int regulator_mode_constrain(struct regulator_dev *rdev, int *mode) ...@@ -221,6 +227,7 @@ static int regulator_mode_constrain(struct regulator_dev *rdev, int *mode)
case REGULATOR_MODE_STANDBY: case REGULATOR_MODE_STANDBY:
break; break;
default: default:
rdev_err(rdev, "invalid mode %x specified\n", *mode);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment