From: Mark Brown Date: Sun, 11 Mar 2012 13:07:56 +0000 (+0000) Subject: regulator: Support driver probe deferral X-Git-Tag: MMI-PSA29.97-13-9~17269^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=04bf30115f4ba2beda1efb6cfbae49cdc757f3a9;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Acked-by: Grant Likely Acked-by: Liam Girdwood Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index e9a83f84adaf..fcde037b3461 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -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; @@ -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; }