Skip to content

Commit

Permalink
regulator: Support driver probe deferral
Browse files Browse the repository at this point in the history
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 <broonie@opensource.wolfsonmicro.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Mark Brown authored and Greg Kroah-Hartman committed Mar 12, 2012
1 parent 263a5c8 commit 04bf301
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
{
struct regulator_dev *rdev;
struct regulator_map *map;
struct regulator *regulator = ERR_PTR(-ENODEV);
struct regulator *regulator = ERR_PTR(-EPROBE_DEFER);
const char *devname = NULL;
int ret;

Expand Down Expand Up @@ -2834,7 +2834,7 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,

if (!r) {
dev_err(dev, "Failed to find supply %s\n", supply);
ret = -ENODEV;
ret = -EPROBE_DEFER;
goto scrub;
}

Expand Down

0 comments on commit 04bf301

Please sign in to comment.