aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-02-05 18:52:26 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-02-05 18:52:26 -0500
commit71c27a8c67e85b216f150696b04f698bff9256fa (patch)
treeb491dd902006a95da65215f5aa6419542028702c
parent4293242db153512dcfc7e7af9af683e5b97dd4ce (diff)
parenta6a671e1b6f6e68b642445ad3cac46f8ffb46f5c (diff)
Merge tag 'regulator-v3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator fixes from Mark Brown: "A couple of driver fixes here but the main thing is a fix to the checks for deferred probe non-DT systems with fully specified regulators which had been broken by a device tree fix which meant that we wouldn't insert optional regulators. This had slipped through the cracks since very few systems do that in the first place and those that do it in mainline don't need optional regulators anyway" * tag 'regulator-v3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: s2mps11: Fix NULL pointer of_node value when using platform data regulator: core: Correct default return value for full constraints regulator: ab3100: cast fix
-rw-r--r--drivers/regulator/ab3100.c4
-rw-r--r--drivers/regulator/core.c9
-rw-r--r--drivers/regulator/s2mps11.c1
3 files changed, 11 insertions, 3 deletions
diff --git a/drivers/regulator/ab3100.c b/drivers/regulator/ab3100.c
index 77b46d0b37a6..e10febe9ec34 100644
--- a/drivers/regulator/ab3100.c
+++ b/drivers/regulator/ab3100.c
@@ -498,7 +498,7 @@ static int ab3100_regulator_register(struct platform_device *pdev,
498 struct ab3100_platform_data *plfdata, 498 struct ab3100_platform_data *plfdata,
499 struct regulator_init_data *init_data, 499 struct regulator_init_data *init_data,
500 struct device_node *np, 500 struct device_node *np,
501 int id) 501 unsigned long id)
502{ 502{
503 struct regulator_desc *desc; 503 struct regulator_desc *desc;
504 struct ab3100_regulator *reg; 504 struct ab3100_regulator *reg;
@@ -646,7 +646,7 @@ ab3100_regulator_of_probe(struct platform_device *pdev, struct device_node *np)
646 err = ab3100_regulator_register( 646 err = ab3100_regulator_register(
647 pdev, NULL, ab3100_regulator_matches[i].init_data, 647 pdev, NULL, ab3100_regulator_matches[i].init_data,
648 ab3100_regulator_matches[i].of_node, 648 ab3100_regulator_matches[i].of_node,
649 (int) ab3100_regulator_matches[i].driver_data); 649 (unsigned long)ab3100_regulator_matches[i].driver_data);
650 if (err) { 650 if (err) {
651 ab3100_regulators_remove(pdev); 651 ab3100_regulators_remove(pdev);
652 return err; 652 return err;
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index b38a6b669e8c..16a309e5c024 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1272,6 +1272,8 @@ static struct regulator_dev *regulator_dev_lookup(struct device *dev,
1272 if (r->dev.parent && 1272 if (r->dev.parent &&
1273 node == r->dev.of_node) 1273 node == r->dev.of_node)
1274 return r; 1274 return r;
1275 *ret = -EPROBE_DEFER;
1276 return NULL;
1275 } else { 1277 } else {
1276 /* 1278 /*
1277 * If we couldn't even get the node then it's 1279 * If we couldn't even get the node then it's
@@ -1312,7 +1314,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
1312 struct regulator_dev *rdev; 1314 struct regulator_dev *rdev;
1313 struct regulator *regulator = ERR_PTR(-EPROBE_DEFER); 1315 struct regulator *regulator = ERR_PTR(-EPROBE_DEFER);
1314 const char *devname = NULL; 1316 const char *devname = NULL;
1315 int ret = -EPROBE_DEFER; 1317 int ret;
1316 1318
1317 if (id == NULL) { 1319 if (id == NULL) {
1318 pr_err("get() with no identifier\n"); 1320 pr_err("get() with no identifier\n");
@@ -1322,6 +1324,11 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
1322 if (dev) 1324 if (dev)
1323 devname = dev_name(dev); 1325 devname = dev_name(dev);
1324 1326
1327 if (have_full_constraints())
1328 ret = -ENODEV;
1329 else
1330 ret = -EPROBE_DEFER;
1331
1325 mutex_lock(&regulator_list_mutex); 1332 mutex_lock(&regulator_list_mutex);
1326 1333
1327 rdev = regulator_dev_lookup(dev, id, &ret); 1334 rdev = regulator_dev_lookup(dev, id, &ret);
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
index d9e557990577..cd0b9e35a56d 100644
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -441,6 +441,7 @@ common_reg:
441 for (i = 0; i < S2MPS11_REGULATOR_MAX; i++) { 441 for (i = 0; i < S2MPS11_REGULATOR_MAX; i++) {
442 if (!reg_np) { 442 if (!reg_np) {
443 config.init_data = pdata->regulators[i].initdata; 443 config.init_data = pdata->regulators[i].initdata;
444 config.of_node = pdata->regulators[i].reg_node;
444 } else { 445 } else {
445 config.init_data = rdata[i].init_data; 446 config.init_data = rdata[i].init_data;
446 config.of_node = rdata[i].of_node; 447 config.of_node = rdata[i].of_node;