aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/regulator/act8865-regulator.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c
index a1cd0d4f8257..7652477e6a9d 100644
--- a/drivers/regulator/act8865-regulator.c
+++ b/drivers/regulator/act8865-regulator.c
@@ -395,12 +395,6 @@ static int act8865_pdata_from_dt(struct device *dev,
395 struct act8865_regulator_data *regulator; 395 struct act8865_regulator_data *regulator;
396 struct of_regulator_match *matches; 396 struct of_regulator_match *matches;
397 397
398 np = of_get_child_by_name(dev->of_node, "regulators");
399 if (!np) {
400 dev_err(dev, "missing 'regulators' subnode in DT\n");
401 return -EINVAL;
402 }
403
404 switch (type) { 398 switch (type) {
405 case ACT8600: 399 case ACT8600:
406 matches = act8600_matches; 400 matches = act8600_matches;
@@ -419,6 +413,12 @@ static int act8865_pdata_from_dt(struct device *dev,
419 return -EINVAL; 413 return -EINVAL;
420 } 414 }
421 415
416 np = of_get_child_by_name(dev->of_node, "regulators");
417 if (!np) {
418 dev_err(dev, "missing 'regulators' subnode in DT\n");
419 return -EINVAL;
420 }
421
422 matched = of_regulator_match(dev, np, matches, num_matches); 422 matched = of_regulator_match(dev, np, matches, num_matches);
423 of_node_put(np); 423 of_node_put(np);
424 if (matched <= 0) 424 if (matched <= 0)