RE: [PATCH 7/7] devfreq: exynos-bus: add missing of_node_put after calling of_parse_phandle
> > - Original Message - > Sender : Peter Chen <peter.c...@nxp.com> > Date : 2016-07-01 18:49 (GMT+9) > Title : [PATCH 7/7] devfreq: exynos-bus: add missing of_node_put after > calling of_parse_phandle > > of_node_put needs to be called when the device node which is got > from of_parse_phandle has finished using. > > Cc: Chanwoo Choi <cw00.c...@samsung.com> > Cc: MyungJoo Ham <myungjoo@samsung.com> > Cc: Kyungmin Park <kyungmin.p...@samsung.com> > Cc: Kukjin Kim <kg...@kernel.org> > Cc: Krzysztof Kozlowski <k.kozlow...@samsung.com> > Signed-off-by: Peter Chen <peter.c...@nxp.com> With the change (build error fix) of the following added, (I'll update) Signed-off-by: MyungJoo Ham <myungjoo@samsung.com> Cheers, MyungJoo > --- > drivers/devfreq/exynos-bus.c | 9 ++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c > index 2363d0a..a38b5ec 100644 > --- a/drivers/devfreq/exynos-bus.c > +++ b/drivers/devfreq/exynos-bus.c > @@ -383,7 +383,7 @@ err_clk: > static int exynos_bus_probe(struct platform_device *pdev) > { > struct device *dev = >dev; > -struct device_node *np = dev->of_node; > +struct device_node *np = dev->of_node, node; + struct device_node *np = dev->of_node, *node; > struct devfreq_dev_profile *profile; > struct devfreq_simple_ondemand_data *ondemand_data; > struct devfreq_passive_data *passive_data; ...
Re: [PATCH 7/7] devfreq: exynos-bus: add missing of_node_put after calling of_parse_phandle
Hi Peter, 2016-07-01 18:42 GMT+09:00 Peter Chen: > of_node_put needs to be called when the device node which is got > from of_parse_phandle has finished using. > > Cc: Chanwoo Choi > Cc: MyungJoo Ham > Cc: Kyungmin Park > Cc: Kukjin Kim > Cc: Krzysztof Kozlowski > Signed-off-by: Peter Chen > --- > drivers/devfreq/exynos-bus.c | 9 ++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c > index 2363d0a..a38b5ec 100644 > --- a/drivers/devfreq/exynos-bus.c > +++ b/drivers/devfreq/exynos-bus.c > @@ -383,7 +383,7 @@ err_clk: > static int exynos_bus_probe(struct platform_device *pdev) > { > struct device *dev = >dev; > - struct device_node *np = dev->of_node; > + struct device_node *np = dev->of_node, node; > struct devfreq_dev_profile *profile; > struct devfreq_simple_ondemand_data *ondemand_data; > struct devfreq_passive_data *passive_data; > @@ -415,10 +415,13 @@ static int exynos_bus_probe(struct platform_device > *pdev) > goto err; > } > > - if (of_parse_phandle(dev->of_node, "devfreq", 0)) > + node = of_parse_phandle(dev->of_node, "devfreq", 0); > + if (node) { > + of_node_put(node); > goto passive; > - else > + } else { > ret = exynos_bus_parent_parse_of(np, bus); > + } > > if (ret < 0) > goto err; Acked-by: Chanwoo Choi Regards, Chanwoo Choi
[PATCH 7/7] devfreq: exynos-bus: add missing of_node_put after calling of_parse_phandle
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using. Cc: Chanwoo ChoiCc: MyungJoo Ham Cc: Kyungmin Park Cc: Kukjin Kim Cc: Krzysztof Kozlowski Signed-off-by: Peter Chen --- drivers/devfreq/exynos-bus.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index 2363d0a..a38b5ec 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -383,7 +383,7 @@ err_clk: static int exynos_bus_probe(struct platform_device *pdev) { struct device *dev = >dev; - struct device_node *np = dev->of_node; + struct device_node *np = dev->of_node, node; struct devfreq_dev_profile *profile; struct devfreq_simple_ondemand_data *ondemand_data; struct devfreq_passive_data *passive_data; @@ -415,10 +415,13 @@ static int exynos_bus_probe(struct platform_device *pdev) goto err; } - if (of_parse_phandle(dev->of_node, "devfreq", 0)) + node = of_parse_phandle(dev->of_node, "devfreq", 0); + if (node) { + of_node_put(node); goto passive; - else + } else { ret = exynos_bus_parent_parse_of(np, bus); + } if (ret < 0) goto err; -- 1.9.1