Skip to content

Commit

Permalink
regulator: remove unnecessary of_node_get() to parent
Browse files Browse the repository at this point in the history
These of_node_get() were added to balance refcount decrements inside of
of_find_node_by_name().
See: commit c92f5dd ("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>
  • Loading branch information
Guodong Xu authored and Mark Brown committed Sep 10, 2014
1 parent 7d1311b commit b8b27a4
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion drivers/regulator/88pm8607.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev,
struct regulator_config *config)
{
struct device_node *nproot, *np;
nproot = of_node_get(pdev->dev.parent->of_node);
nproot = pdev->dev.parent->of_node;
if (!nproot)
return -ENODEV;
nproot = of_get_child_by_name(nproot, "regulators");
Expand Down
4 changes: 2 additions & 2 deletions drivers/regulator/da9052-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,9 @@ static int da9052_regulator_probe(struct platform_device *pdev)
config.init_data = pdata->regulators[pdev->id];
} else {
#ifdef CONFIG_OF
struct device_node *nproot, *np;
struct device_node *nproot = da9052->dev->of_node;
struct device_node *np;

nproot = of_node_get(da9052->dev->of_node);
if (!nproot)
return -ENODEV;

Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/max8907-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ static int max8907_regulator_parse_dt(struct platform_device *pdev)
struct device_node *np, *regulators;
int ret;

np = of_node_get(pdev->dev.parent->of_node);
np = pdev->dev.parent->of_node;
if (!np)
return 0;

Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/max8925-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev,
struct device_node *nproot, *np;
int rcount;

nproot = of_node_get(pdev->dev.parent->of_node);
nproot = pdev->dev.parent->of_node;
if (!nproot)
return -ENODEV;
np = of_get_child_by_name(nproot, "regulators");
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/max8997.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev,
struct max8997_regulator_data *rdata;
unsigned int i, dvs_voltage_nr = 1, ret;

pmic_np = of_node_get(iodev->dev->of_node);
pmic_np = iodev->dev->of_node;
if (!pmic_np) {
dev_err(&pdev->dev, "could not find pmic sub-node\n");
return -ENODEV;
Expand Down
1 change: 0 additions & 1 deletion drivers/regulator/palmas-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,6 @@ static void palmas_dt_to_pdata(struct device *dev,
u32 prop;
int idx, ret;

node = of_node_get(node);
regulators = of_get_child_by_name(node, "regulators");
if (!regulators) {
dev_info(dev, "regulator node not found\n");
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/tps65910-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data(
if (!pmic_plat_data)
return NULL;

np = of_node_get(pdev->dev.parent->of_node);
np = pdev->dev.parent->of_node;
regulators = of_get_child_by_name(np, "regulators");
if (!regulators) {
dev_err(&pdev->dev, "regulator node not found\n");
Expand Down

0 comments on commit b8b27a4

Please sign in to comment.