Commit 89f425ed5bf3d4fd97e840296dccd75b8e0fe4c9

Authored by Mark Brown
Committed by Liam Girdwood
1 parent 39aa9b6e3c

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: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>

Showing 1 changed file with 9 additions and 2 deletions Side-by-side Diff

drivers/regulator/core.c
... ... @@ -151,8 +151,11 @@
151 151 if (*min_uV < rdev->constraints->min_uV)
152 152 *min_uV = rdev->constraints->min_uV;
153 153  
154   - if (*min_uV > *max_uV)
  154 + if (*min_uV > *max_uV) {
  155 + rdev_err(rdev, "unsupportable voltage range: %d-%duV\n",
  156 + min_uV, max_uV);
155 157 return -EINVAL;
  158 + }
156 159  
157 160 return 0;
158 161 }
159 162  
... ... @@ -205,8 +208,11 @@
205 208 if (*min_uA < rdev->constraints->min_uA)
206 209 *min_uA = rdev->constraints->min_uA;
207 210  
208   - if (*min_uA > *max_uA)
  211 + if (*min_uA > *max_uA) {
  212 + rdev_err(rdev, "unsupportable current range: %d-%duA\n",
  213 + min_uA, max_uA);
209 214 return -EINVAL;
  215 + }
210 216  
211 217 return 0;
212 218 }
... ... @@ -221,6 +227,7 @@
221 227 case REGULATOR_MODE_STANDBY:
222 228 break;
223 229 default:
  230 + rdev_err(rdev, "invalid mode %x specified\n", *mode);
224 231 return -EINVAL;
225 232 }
226 233