From: Mark Brown <broo...@opensource.wolfsonmicro.com>

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 <broo...@opensource.wolfsonmicro.com>
[manj...@ti.com: changed error value from EAGAIN to EPROBE_DEFER]
Signed-off-by: G, Manjunath Kondaiah <manj...@ti.com>
Acked-by: Grant Likely <grant.lik...@secretlab.ca>
Acked-by: Liam Girdwood <l...@ti.com>
---
Cc: linux-omap@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Cc: Grant Likely <grant.lik...@secretlab.ca>
Cc: Greg Kroah-Hartman <g...@kroah.com>
Cc: Dilan Lee <di...@nvidia.com>
Cc: Mark Brown <broo...@opensource.wolfsonmicro.com>
Cc: Manjunath GKondaiah <manjunath.gkonda...@linaro.org>
Cc: Arnd Bergmann <a...@arndb.de>

 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-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to