Skip to contentSkip to conversation

regulator: Support driver probe deferral

PATCH In review Mark Brown 2 participants 2 messages Sep 29, 2011 Voltage and current regulator framework

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 regulator: Support driver probe deferral

If we fail to locate a requested regulator return -EAGAIN. 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.

---

This depends on Grant's change to implement deferred probing, the error code for which is going to change in the next revision. Liam, if you're also OK with this change I propose that we both ack it and let it get carried along with the deferred probing change.

 drivers/regulator/core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/core.c +2 -2
index d5656b7..b39ec9f 100644
@@ -1154,7 +1154,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(-EAGAIN);
 	const char *devname = NULL;
 	int ret;
 
@@ -2727,7 +2727,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 = -EAGAIN;
 			goto scrub;
 		}
 
Signature · 1 line
1.7.6.3
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Mark Brown

If we fail to locate a requested regulator return -EAGAIN. 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.

Manjunath, can you add this to a series with the deferred probe patch? You'll need to change the return code as discussed in the other thread.

g.

Quoted 35 lines

---

This depends on Grant's change to implement deferred probing, the error code for which is going to change in the next revision. Liam, if you're also OK with this change I propose that we both ack it and let it get carried along with the deferred probing change.

 drivers/regulator/core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/core.c +2 -2
index d5656b7..b39ec9f 100644
@@ -1154,7 +1154,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(-EAGAIN);
 	const char *devname = NULL;
 	int ret;
 
@@ -2727,7 +2727,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 = -EAGAIN;
 			goto scrub;
 		}
 
Signature · 1 line
1.7.6.3