From c92f5dd2c42fa61e0ef810fad4584b184ea2d50e Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sun, 27 Jan 2013 21:16:56 +0800 Subject: 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 Signed-off-by: Mark Brown --- drivers/regulator/da9052-regulator.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/regulator/da9052-regulator.c') diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c index d0963090442d..29d194c8a310 100644 --- a/drivers/regulator/da9052-regulator.c +++ b/drivers/regulator/da9052-regulator.c @@ -395,9 +395,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 = da9052->dev->of_node; - struct device_node *np; + struct device_node *nproot, *np; + nproot = of_node_get(da9052->dev->of_node); if (!nproot) return -ENODEV; @@ -414,6 +414,7 @@ static int da9052_regulator_probe(struct platform_device *pdev) break; } } + of_node_put(nproot); #endif } -- cgit v1.2.1