[PATCH 3/5] regulator: Support driver probe deferral

From: G, Manjunath Kondaiah
Date: Fri Oct 07 2011 - 01:08:50 EST



From: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>

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.

Signed-off-by: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
[manjugk@xxxxxx: changed error value from EAGAIN to EPROBE_DEFER]
Signed-off-by: G, Manjunath Kondaiah <manjugk@xxxxxx>
Acked-by: Grant Likely <grant.likely@xxxxxxxxxxxx>
Acked-by: Liam Girdwood <lrg@xxxxxx>
---
Cc: linux-omap@xxxxxxxxxxxxxxx
Cc: linux-mmc@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: Grant Likely <grant.likely@xxxxxxxxxxxx>
Cc: Greg Kroah-Hartman <greg@xxxxxxxxx>
Cc: Dilan Lee <dilee@xxxxxxxxxx>
Cc: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Cc: Manjunath GKondaiah <manjunath.gkondaiah@xxxxxxxxxx>
Cc: Arnd Bergmann <arnd@xxxxxxxx>

drivers/regulator/core.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index d8e6a42..95dfd21 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1153,7 +1153,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;

@@ -2668,7 +2668,7 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
if (!found) {
dev_err(dev, "Failed to find supply %s\n",
init_data->supply_regulator);
- ret = -ENODEV;
+ ret = -EPROBE_DEFER;
goto scrub;
}

--
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/