Skip to content

Commit 04bf301

Browse files
brooniegregkh
authored andcommitted
regulator: Support driver probe deferral
If we fail to locate a requested regulator return -EPROBE_DEFER. If drivers pass this error code through to their caller (which they really should) then this will ensure that the probe is retried later when further devices become available. In the unusual case where a driver doesn't want this it can override the default behaviour. Signed-off-by: Mark Brown <[email protected]> Acked-by: Grant Likely <[email protected]> Acked-by: Liam Girdwood <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 263a5c8 commit 04bf301

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/regulator/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
12101210
{
12111211
struct regulator_dev *rdev;
12121212
struct regulator_map *map;
1213-
struct regulator *regulator = ERR_PTR(-ENODEV);
1213+
struct regulator *regulator = ERR_PTR(-EPROBE_DEFER);
12141214
const char *devname = NULL;
12151215
int ret;
12161216

@@ -2834,7 +2834,7 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
28342834

28352835
if (!r) {
28362836
dev_err(dev, "Failed to find supply %s\n", supply);
2837-
ret = -ENODEV;
2837+
ret = -EPROBE_DEFER;
28382838
goto scrub;
28392839
}
28402840

0 commit comments

Comments
 (0)