aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuodong Xu <guodong.xu@linaro.org>2014-09-09 23:50:39 -0400
committerMark Brown <broonie@kernel.org>2014-09-10 06:35:02 -0400
commitb8b27a44ddf1987e9bae84b99741b0a61192e017 (patch)
tree8516c54902fe34fc84693686bd90b06413390d8e
parent7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9 (diff)
regulator: remove unnecessary of_node_get() to parent
These of_node_get() were added to balance refcount decrements inside of of_find_node_by_name(). See: commit c92f5dd2c42f ("regulator: Add missing of_node_put()") However of_find_node_by_name() was then replaced by of_get_child_by_name(), which doesn't call of_node_put() against its input parameter. So, need to remove these unnecessary of_node_get() calls. Signed-off-by: Guodong Xu <guodong.xu@linaro.org> Reviewed-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/regulator/88pm8607.c2
-rw-r--r--drivers/regulator/da9052-regulator.c4
-rw-r--r--drivers/regulator/max8907-regulator.c2
-rw-r--r--drivers/regulator/max8925-regulator.c2
-rw-r--r--drivers/regulator/max8997.c2
-rw-r--r--drivers/regulator/palmas-regulator.c1
-rw-r--r--drivers/regulator/tps65910-regulator.c2
7 files changed, 7 insertions, 8 deletions
diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c
index 337634ad0562..6d77dcd7dcf6 100644
--- a/drivers/regulator/88pm8607.c
+++ b/drivers/regulator/88pm8607.c
@@ -319,7 +319,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev,
319 struct regulator_config *config) 319 struct regulator_config *config)
320{ 320{
321 struct device_node *nproot, *np; 321 struct device_node *nproot, *np;
322 nproot = of_node_get(pdev->dev.parent->of_node); 322 nproot = pdev->dev.parent->of_node;
323 if (!nproot) 323 if (!nproot)
324 return -ENODEV; 324 return -ENODEV;
325 nproot = of_get_child_by_name(nproot, "regulators"); 325 nproot = of_get_child_by_name(nproot, "regulators");
diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c
index fdb6ea8ae7e6..00033625a09c 100644
--- a/drivers/regulator/da9052-regulator.c
+++ b/drivers/regulator/da9052-regulator.c
@@ -422,9 +422,9 @@ static int da9052_regulator_probe(struct platform_device *pdev)
422 config.init_data = pdata->regulators[pdev->id]; 422 config.init_data = pdata->regulators[pdev->id];
423 } else { 423 } else {
424#ifdef CONFIG_OF 424#ifdef CONFIG_OF
425 struct device_node *nproot, *np; 425 struct device_node *nproot = da9052->dev->of_node;
426 struct device_node *np;
426 427
427 nproot = of_node_get(da9052->dev->of_node);
428 if (!nproot) 428 if (!nproot)
429 return -ENODEV; 429 return -ENODEV;
430 430
diff --git a/drivers/regulator/max8907-regulator.c b/drivers/regulator/max8907-regulator.c
index 9623e9e290bf..3426be89c9f6 100644
--- a/drivers/regulator/max8907-regulator.c
+++ b/drivers/regulator/max8907-regulator.c
@@ -226,7 +226,7 @@ static int max8907_regulator_parse_dt(struct platform_device *pdev)
226 struct device_node *np, *regulators; 226 struct device_node *np, *regulators;
227 int ret; 227 int ret;
228 228
229 np = of_node_get(pdev->dev.parent->of_node); 229 np = pdev->dev.parent->of_node;
230 if (!np) 230 if (!np)
231 return 0; 231 return 0;
232 232
diff --git a/drivers/regulator/max8925-regulator.c b/drivers/regulator/max8925-regulator.c
index dad2bcd14e96..7770777befc4 100644
--- a/drivers/regulator/max8925-regulator.c
+++ b/drivers/regulator/max8925-regulator.c
@@ -250,7 +250,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev,
250 struct device_node *nproot, *np; 250 struct device_node *nproot, *np;
251 int rcount; 251 int rcount;
252 252
253 nproot = of_node_get(pdev->dev.parent->of_node); 253 nproot = pdev->dev.parent->of_node;
254 if (!nproot) 254 if (!nproot)
255 return -ENODEV; 255 return -ENODEV;
256 np = of_get_child_by_name(nproot, "regulators"); 256 np = of_get_child_by_name(nproot, "regulators");
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c
index 90b4c530dee5..9c31e215a521 100644
--- a/drivers/regulator/max8997.c
+++ b/drivers/regulator/max8997.c
@@ -917,7 +917,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev,
917 struct max8997_regulator_data *rdata; 917 struct max8997_regulator_data *rdata;
918 unsigned int i, dvs_voltage_nr = 1, ret; 918 unsigned int i, dvs_voltage_nr = 1, ret;
919 919
920 pmic_np = of_node_get(iodev->dev->of_node); 920 pmic_np = iodev->dev->of_node;
921 if (!pmic_np) { 921 if (!pmic_np) {
922 dev_err(&pdev->dev, "could not find pmic sub-node\n"); 922 dev_err(&pdev->dev, "could not find pmic sub-node\n");
923 return -ENODEV; 923 return -ENODEV;
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index a7ce34d1b5f2..1878e5b567ef 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -1427,7 +1427,6 @@ static void palmas_dt_to_pdata(struct device *dev,
1427 u32 prop; 1427 u32 prop;
1428 int idx, ret; 1428 int idx, ret;
1429 1429
1430 node = of_node_get(node);
1431 regulators = of_get_child_by_name(node, "regulators"); 1430 regulators = of_get_child_by_name(node, "regulators");
1432 if (!regulators) { 1431 if (!regulators) {
1433 dev_info(dev, "regulator node not found\n"); 1432 dev_info(dev, "regulator node not found\n");
diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
index fa7db8847578..e584c998b55f 100644
--- a/drivers/regulator/tps65910-regulator.c
+++ b/drivers/regulator/tps65910-regulator.c
@@ -1014,7 +1014,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data(
1014 if (!pmic_plat_data) 1014 if (!pmic_plat_data)
1015 return NULL; 1015 return NULL;
1016 1016
1017 np = of_node_get(pdev->dev.parent->of_node); 1017 np = pdev->dev.parent->of_node;
1018 regulators = of_get_child_by_name(np, "regulators"); 1018 regulators = of_get_child_by_name(np, "regulators");
1019 if (!regulators) { 1019 if (!regulators) {
1020 dev_err(&pdev->dev, "regulator node not found\n"); 1020 dev_err(&pdev->dev, "regulator node not found\n");