diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-01-27 21:16:56 +0800 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-01-30 18:50:27 +0800 |
commit | c92f5dd2c42fa61e0ef810fad4584b184ea2d50e (patch) | |
tree | c0d7f598b23259342ea4e912607156fb7acef2d2 /drivers/regulator/tps65910-regulator.c | |
parent | 9c9588a7326bdebf49f5d205dd4243c0d1df73d5 (diff) | |
download | linux-c92f5dd2c42fa61e0ef810fad4584b184ea2d50e.tar.bz2 |
regulator: Add missing of_node_put()
of_find_node_by_name() returns a node pointer with refcount incremented, use
of_node_put() on it when done.
of_find_node_by_name() will call of_node_put() against from parameter,
thus we also need to call of_node_get(from) before calling
of_find_node_by_name().
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/tps65910-regulator.c')
-rw-r--r-- | drivers/regulator/tps65910-regulator.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c index b0e4c0bc85c3..6ba6931ac855 100644 --- a/drivers/regulator/tps65910-regulator.c +++ b/drivers/regulator/tps65910-regulator.c @@ -964,8 +964,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data( { struct tps65910_board *pmic_plat_data; struct tps65910 *tps65910 = dev_get_drvdata(pdev->dev.parent); - struct device_node *np = pdev->dev.parent->of_node; - struct device_node *regulators; + struct device_node *np, *regulators; struct of_regulator_match *matches; unsigned int prop; int idx = 0, ret, count; @@ -978,6 +977,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data( return NULL; } + np = of_node_get(pdev->dev.parent->of_node); regulators = of_find_node_by_name(np, "regulators"); if (!regulators) { dev_err(&pdev->dev, "regulator node not found\n"); @@ -994,11 +994,13 @@ static struct tps65910_board *tps65910_parse_dt_reg_data( matches = tps65911_matches; break; default: + of_node_put(regulators); dev_err(&pdev->dev, "Invalid tps chip version\n"); return NULL; } ret = of_regulator_match(&pdev->dev, regulators, matches, count); + of_node_put(regulators); if (ret < 0) { dev_err(&pdev->dev, "Error parsing regulator init data: %d\n", ret); |