diff options
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r-- | drivers/regulator/core.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 3fe13130baec..d85f31385b24 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -119,6 +119,11 @@ static const char *rdev_get_name(struct regulator_dev *rdev) | |||
119 | return ""; | 119 | return ""; |
120 | } | 120 | } |
121 | 121 | ||
122 | static bool have_full_constraints(void) | ||
123 | { | ||
124 | return has_full_constraints || of_have_populated_dt(); | ||
125 | } | ||
126 | |||
122 | /** | 127 | /** |
123 | * of_get_regulator - get a regulator device node based on supply name | 128 | * of_get_regulator - get a regulator device node based on supply name |
124 | * @dev: Device pointer for the consumer (of regulator) device | 129 | * @dev: Device pointer for the consumer (of regulator) device |
@@ -1340,7 +1345,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id, | |||
1340 | * Assume that a regulator is physically present and enabled | 1345 | * Assume that a regulator is physically present and enabled |
1341 | * even if it isn't hooked up and just provide a dummy. | 1346 | * even if it isn't hooked up and just provide a dummy. |
1342 | */ | 1347 | */ |
1343 | if (has_full_constraints && allow_dummy) { | 1348 | if (have_full_constraints() && allow_dummy) { |
1344 | pr_warn("%s supply %s not found, using dummy regulator\n", | 1349 | pr_warn("%s supply %s not found, using dummy regulator\n", |
1345 | devname, id); | 1350 | devname, id); |
1346 | 1351 | ||
@@ -3627,7 +3632,7 @@ int regulator_suspend_finish(void) | |||
3627 | if (error) | 3632 | if (error) |
3628 | ret = error; | 3633 | ret = error; |
3629 | } else { | 3634 | } else { |
3630 | if (!has_full_constraints) | 3635 | if (!have_full_constraints()) |
3631 | goto unlock; | 3636 | goto unlock; |
3632 | if (!ops->disable) | 3637 | if (!ops->disable) |
3633 | goto unlock; | 3638 | goto unlock; |
@@ -3825,7 +3830,7 @@ static int __init regulator_init_complete(void) | |||
3825 | if (!enabled) | 3830 | if (!enabled) |
3826 | goto unlock; | 3831 | goto unlock; |
3827 | 3832 | ||
3828 | if (has_full_constraints) { | 3833 | if (have_full_constraints()) { |
3829 | /* We log since this may kill the system if it | 3834 | /* We log since this may kill the system if it |
3830 | * goes wrong. */ | 3835 | * goes wrong. */ |
3831 | rdev_info(rdev, "disabling\n"); | 3836 | rdev_info(rdev, "disabling\n"); |