提交 71c27a8c 编写于 作者: L Linus Torvalds

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
...@@ -498,7 +498,7 @@ static int ab3100_regulator_register(struct platform_device *pdev, ...@@ -498,7 +498,7 @@ static int ab3100_regulator_register(struct platform_device *pdev,
struct ab3100_platform_data *plfdata, struct ab3100_platform_data *plfdata,
struct regulator_init_data *init_data, struct regulator_init_data *init_data,
struct device_node *np, struct device_node *np,
int id) unsigned long id)
{ {
struct regulator_desc *desc; struct regulator_desc *desc;
struct ab3100_regulator *reg; struct ab3100_regulator *reg;
...@@ -646,7 +646,7 @@ ab3100_regulator_of_probe(struct platform_device *pdev, struct device_node *np) ...@@ -646,7 +646,7 @@ ab3100_regulator_of_probe(struct platform_device *pdev, struct device_node *np)
err = ab3100_regulator_register( err = ab3100_regulator_register(
pdev, NULL, ab3100_regulator_matches[i].init_data, pdev, NULL, ab3100_regulator_matches[i].init_data,
ab3100_regulator_matches[i].of_node, ab3100_regulator_matches[i].of_node,
(int) ab3100_regulator_matches[i].driver_data); (unsigned long)ab3100_regulator_matches[i].driver_data);
if (err) { if (err) {
ab3100_regulators_remove(pdev); ab3100_regulators_remove(pdev);
return err; return err;
......
...@@ -1272,6 +1272,8 @@ static struct regulator_dev *regulator_dev_lookup(struct device *dev, ...@@ -1272,6 +1272,8 @@ static struct regulator_dev *regulator_dev_lookup(struct device *dev,
if (r->dev.parent && if (r->dev.parent &&
node == r->dev.of_node) node == r->dev.of_node)
return r; return r;
*ret = -EPROBE_DEFER;
return NULL;
} else { } else {
/* /*
* If we couldn't even get the node then it's * 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,7 +1314,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
struct regulator_dev *rdev; struct regulator_dev *rdev;
struct regulator *regulator = ERR_PTR(-EPROBE_DEFER); struct regulator *regulator = ERR_PTR(-EPROBE_DEFER);
const char *devname = NULL; const char *devname = NULL;
int ret = -EPROBE_DEFER; int ret;
if (id == NULL) { if (id == NULL) {
pr_err("get() with no identifier\n"); pr_err("get() with no identifier\n");
...@@ -1322,6 +1324,11 @@ static struct regulator *_regulator_get(struct device *dev, const char *id, ...@@ -1322,6 +1324,11 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
if (dev) if (dev)
devname = dev_name(dev); devname = dev_name(dev);
if (have_full_constraints())
ret = -ENODEV;
else
ret = -EPROBE_DEFER;
mutex_lock(&regulator_list_mutex); mutex_lock(&regulator_list_mutex);
rdev = regulator_dev_lookup(dev, id, &ret); rdev = regulator_dev_lookup(dev, id, &ret);
......
...@@ -441,6 +441,7 @@ static int s2mps11_pmic_probe(struct platform_device *pdev) ...@@ -441,6 +441,7 @@ static int s2mps11_pmic_probe(struct platform_device *pdev)
for (i = 0; i < S2MPS11_REGULATOR_MAX; i++) { for (i = 0; i < S2MPS11_REGULATOR_MAX; i++) {
if (!reg_np) { if (!reg_np) {
config.init_data = pdata->regulators[i].initdata; config.init_data = pdata->regulators[i].initdata;
config.of_node = pdata->regulators[i].reg_node;
} else { } else {
config.init_data = rdata[i].init_data; config.init_data = rdata[i].init_data;
config.of_node = rdata[i].of_node; config.of_node = rdata[i].of_node;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册