regulator: core: Log when a device causes a voltage constraint fail
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 28 Nov 2012 17:09:27 +0000 (17:09 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 28 Nov 2012 17:47:18 +0000 (17:47 +0000)
Helps with figuring out when things went wrong.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/core.c

index e872c8be080ed427a2e546efffee50c12acdd9fe..e7fffd15953fed4a43a07227ad154b8cf9c1074d 100644 (file)
@@ -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;
 }