Unified · Split
| @@ -119,6 +119,11 @@ static const char *rdev_get_name(struct regulator_dev *rdev) · 118 unmodified lines | ||
| 119 | 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 | 128 | * of_get_regulator - get a regulator device node based on supply name |
| 124 | 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, · 1215 unmodified lines | ||
| 1340 | 1345 | * Assume that a regulator is physically present and enabled |
| 1341 | 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 | 1349 | pr_warn("%s supply %s not found, using dummy regulator\n", |
| 1345 | 1350 | devname, id); |
| 1346 | 1351 | |
| @@ -3627,7 +3632,7 @@ int regulator_suspend_finish(void) · 2280 unmodified lines | ||
| 3627 | 3632 | if (error) |
| 3628 | 3633 | ret = error; |
| 3629 | 3634 | } else { |
| 3630 | − if (!has_full_constraints) | |
| 3635 | + if (!have_full_constraints()) | |
| 3631 | 3636 | goto unlock; |
| 3632 | 3637 | if (!ops->disable) |
| 3633 | 3638 | goto unlock; |
| @@ -3825,7 +3830,7 @@ static int __init regulator_init_complete(void) · 191 unmodified lines | ||
| 3825 | 3830 | if (!enabled) |
| 3826 | 3831 | goto unlock; |
| 3827 | 3832 | |
| 3828 | − if (has_full_constraints) { | |
| 3833 | + if (have_full_constraints()) { | |
| 3829 | 3834 | /* We log since this may kill the system if it |
| 3830 | 3835 | * goes wrong. */ |
| 3831 | 3836 | rdev_info(rdev, "disabling\n"); |