add missing of_node_put after calling of_parse_phandle (1st)
Subsystems (8)
cover add missing of_node_put after calling of_parse_phandle (1st)
Hi all,
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using, but there are many codes do not follow that, this patch set fixes some of them.
Peter Chen (7):
extcon: add missing of_node_put after calling of_parse_phandle
arm: mach-shmobile: pm-rmobile: add missing of_node_put after calling
of_parse_phandle
arm: mach-u300: regulator: add missing of_node_put after calling
of_parse_phandle
bus: arm-cci: add missing of_node_put after calling of_parse_phandle
bus: vexpress-config: add missing of_node_put after calling
of_parse_phandle
devfreq: add missing of_node_put after calling of_parse_phandle
devfreq: exynos-bus: add missing of_node_put after calling
of_parse_phandle
arch/arm/mach-shmobile/pm-rmobile.c | 1 + arch/arm/mach-u300/regulator.c | 12 +++++++++--- drivers/bus/arm-cci.c | 5 ++++- drivers/bus/vexpress-config.c | 1 + drivers/devfreq/devfreq.c | 2 ++ drivers/devfreq/exynos-bus.c | 9 ++++++--- drivers/extcon/extcon.c | 2 ++ 7 files changed, 25 insertions(+), 7 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/7 extcon: 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.
--- drivers/extcon/extcon.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/extcon/extcon.c +2 -0
@@ -1107,10 +1107,12 @@ struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index)list_for_each_entry (edev, &extcon_dev_list, entry) {if (edev->dev.parent && edev->dev.parent->of_node == node) {mutex_unlock (&extcon_dev_list_lock); +of_node_put (node);return edev; } }mutex_unlock (&extcon_dev_list_lock); +of_node_put (node);return ERR_PTR (-EPROBE_DEFER ); }
Signature · 1 line
1.9.1
Re: [PATCH 1/7] extcon: add missing of_node_put after calling of_parse_phandle
Hi Peter,
Applied it.
Regards,
Chanwoo Choi
2016-07-01 18:41 GMT+09:00 Peter Chen <[email protected]>:
Quoted 35 lines
of_node_putneeds to be called when the device node which is got fromof_parse_phandlehas finished using.Cc MyungJoo Ham <[email protected]>Cc Chanwoo Choi <[email protected]>Signed-off-by Peter Chen <[email protected]>--- drivers/extcon/extcon.c | 2 ++ 1 file changed, 2 insertions(+)drivers/extcon/extcon.c +2
-1@@ -1107,10 +1107,12 @@ struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index)list_for_each_entry (edev, &extcon_dev_list, entry) {if (edev->dev.parent && edev->dev.parent->of_node == node) {mutex_unlock (&extcon_dev_list_lock); +of_node_put (node);return edev; } }mutex_unlock (&extcon_dev_list_lock); +of_node_put (node);return ERR_PTR (-EPROBE_DEFER ); } --1.9.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 2/7 arm: mach-shmobile: pm-rmobile: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- arch/arm/mach-shmobile/pm-rmobile.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-shmobile/pm-rmobile.c +1 -0
@@ -209,6 +209,7 @@ static void __init add_special_pd(struct device_node *np, enum pd_types type) special_pds[num_special_pds].pd = pd; special_pds[num_special_pds].type = type; num_special_pds++; +of_node_put (pd); }static void __init get_special_pds (void )
Signature · 1 line
1.9.1
Re: [PATCH 2/7] arm: mach-shmobile: pm-rmobile: add missing of_node_put after calling of_parse_phandle
Hi Peter,
Quoted 6 lines · Peter Chen
of_node_putneeds to be called when the device node which is got fromof_parse_phandlehas finished using.Cc Simon Horman <[email protected]>Cc Magnus Damm <[email protected]>Signed-off-by Peter Chen <[email protected]>
arch/arm/mach-shmobile/pm-rmobile.c static void __init add_special_pd(struct device_node *np, enum pd_types type) · line 209
Quoted 4 lines
arch/arm/mach-shmobile/pm-rmobile.c +0
-0@@ -209,6 +209,7 @@ static void __init add_special_pd(struct device_node *np, enum pd_types type) special_pds[num_special_pds].pd = pd;
The pd pointer is stored in the line above, and released later in put_special_pds().
arch/arm/mach-shmobile/pm-rmobile.c static void __init add_special_pd(struct device_node *np, enum pd_types type) · line 212
Quoted 3 lines
arch/arm/mach-shmobile/pm-rmobile.c +1
-0special_pds[num_special_pds].type = type; num_special_pds++; +of_node_put (pd);
Hence it must not be released here, as that would cause a double release when put_special_pds() is executed.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
RE: [PATCH 2/7] arm: mach-shmobile: pm-rmobile: add missing of_node_put after calling of_parse_phandle
Quoted 17 lines · Peter Chen
Quoted 6 lines
of_node_putneeds to be called when the device node which is got fromof_parse_phandlehas finished using.Cc Simon Horman <[email protected]>Cc Magnus Damm <[email protected]>Signed-off-by Peter Chen <[email protected]>arch/arm/mach-shmobile/pm-rmobile.c static void __init add_special_pd(struct device_node *np,
Quoted 3 lines
arch/arm/mach-shmobile/pm-rmobile.c +0
-0@@ -209,6 +209,7 @@ static void __init add_special_pd(struct device_node *np,enum
pd_typestype)arch/arm/mach-shmobile/pm-rmobile.c static void __init add_special_pd(struct device_node *np, enum pd_types type) · line 209
Quoted 1 line
arch/arm/mach-shmobile/pm-rmobile.c +0
-0special_pds[num_special_pds].pd = pd;
Quoted 9 lines
The pd pointer is stored in the line above, and released later in
put_special_pds().arch/arm/mach-shmobile/pm-rmobile.c static void __init add_special_pd(struct device_node *np, enum pd_types type) · line 212
Quoted 3 lines
arch/arm/mach-shmobile/pm-rmobile.c +1
-0special_pds[num_special_pds].type = type; num_special_pds++; +of_node_put (pd);Hence it must not be released here, as that would cause a double release when
put_special_pds()is executed.
Thanks, Geert, it is my careless.
Please forget this patch.
Peter
PATCH 3/7 arm: mach-u300: regulator: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- arch/arm/mach-u300/regulator.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
arch/arm/mach-u300/regulator.c +9 -3
@@ -71,19 +71,21 @@ static int __init __u300_init_boardpower(struct platform_device *pdev) regmap =syscon_node_to_regmap (syscon_np);if (IS_ERR (regmap)) {pr_crit ("U300: could not locate syscon regmap\n" ); -return PTR_ERR (regmap); + err =PTR_ERR (regmap); + goto error; } main_power_15 =regulator_get (&pdev->dev,"vana15" );if (IS_ERR (main_power_15)) {pr_err ("could not get vana15" ); -return PTR_ERR (main_power_15); + err =PTR_ERR (main_power_15); + goto error; } err =regulator_enable (main_power_15);if (err) {pr_err ("could not enable vana15\n" ); -return err; + goto error; }/*
@@ -99,8 +101,12 @@ static int __init __u300_init_boardpower(struct platform_device *pdev)/* Register globally exported PM poweroff hook */ pm_power_off = u300_pm_poweroff; +of_node_put (syscon_np);return 0 ; +error: +of_node_put (syscon_np); +return err; }static int __init s365_board_probe (struct platform_device *pdev)
Signature · 1 line
1.9.1
Re: [PATCH 3/7] arm: mach-u300: regulator: add missing of_node_put after calling of_parse_phandle
Quoted 5 lines · Peter Chen
of_node_putneeds to be called when the device node which is got fromof_parse_phandlehas finished using.Cc Linus Walleij <[email protected]>Signed-off-by Peter Chen <[email protected]>
Yours,
Linus Walleij
PATCH 3/7 arm: mach-u300: regulator: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- arch/arm/mach-u300/regulator.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
arch/arm/mach-u300/regulator.c +9 -3
@@ -71,19 +71,21 @@ static int __init __u300_init_boardpower(struct platform_device *pdev) regmap =syscon_node_to_regmap (syscon_np);if (IS_ERR (regmap)) {pr_crit ("U300: could not locate syscon regmap\n" ); -return PTR_ERR (regmap); + err =PTR_ERR (regmap); + goto error; } main_power_15 =regulator_get (&pdev->dev,"vana15" );if (IS_ERR (main_power_15)) {pr_err ("could not get vana15" ); -return PTR_ERR (main_power_15); + err =PTR_ERR (main_power_15); + goto error; } err =regulator_enable (main_power_15);if (err) {pr_err ("could not enable vana15\n" ); -return err; + goto error; }/*
@@ -99,8 +101,12 @@ static int __init __u300_init_boardpower(struct platform_device *pdev)/* Register globally exported PM poweroff hook */ pm_power_off = u300_pm_poweroff; +of_node_put (syscon_np);return 0 ; +error: +of_node_put (syscon_np); +return err; }static int __init s365_board_probe (struct platform_device *pdev)
Signature · 1 line
1.9.1
PATCH 3/7 arm: mach-u300: regulator: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- arch/arm/mach-u300/regulator.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
arch/arm/mach-u300/regulator.c +9 -3
@@ -71,19 +71,21 @@ static int __init __u300_init_boardpower(struct platform_device *pdev) regmap =syscon_node_to_regmap (syscon_np);if (IS_ERR (regmap)) {pr_crit ("U300: could not locate syscon regmap\n" ); -return PTR_ERR (regmap); + err =PTR_ERR (regmap); + goto error; } main_power_15 =regulator_get (&pdev->dev,"vana15" );if (IS_ERR (main_power_15)) {pr_err ("could not get vana15" ); -return PTR_ERR (main_power_15); + err =PTR_ERR (main_power_15); + goto error; } err =regulator_enable (main_power_15);if (err) {pr_err ("could not enable vana15\n" ); -return err; + goto error; }/*
@@ -99,8 +101,12 @@ static int __init __u300_init_boardpower(struct platform_device *pdev)/* Register globally exported PM poweroff hook */ pm_power_off = u300_pm_poweroff; +of_node_put (syscon_np);return 0 ; +error: +of_node_put (syscon_np); +return err; }static int __init s365_board_probe (struct platform_device *pdev)
Signature · 1 line
1.9.1
PATCH 3/7 arm: mach-u300: regulator: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- arch/arm/mach-u300/regulator.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
arch/arm/mach-u300/regulator.c +9 -3
@@ -71,19 +71,21 @@ static int __init __u300_init_boardpower(struct platform_device *pdev) regmap =syscon_node_to_regmap (syscon_np);if (IS_ERR (regmap)) {pr_crit ("U300: could not locate syscon regmap\n" ); -return PTR_ERR (regmap); + err =PTR_ERR (regmap); + goto error; } main_power_15 =regulator_get (&pdev->dev,"vana15" );if (IS_ERR (main_power_15)) {pr_err ("could not get vana15" ); -return PTR_ERR (main_power_15); + err =PTR_ERR (main_power_15); + goto error; } err =regulator_enable (main_power_15);if (err) {pr_err ("could not enable vana15\n" ); -return err; + goto error; }/*
@@ -99,8 +101,12 @@ static int __init __u300_init_boardpower(struct platform_device *pdev)/* Register globally exported PM poweroff hook */ pm_power_off = u300_pm_poweroff; +of_node_put (syscon_np);return 0 ; +error: +of_node_put (syscon_np); +return err; }static int __init s365_board_probe (struct platform_device *pdev)
Signature · 1 line
1.9.1
PATCH 3/7 arm: mach-u300: regulator: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- arch/arm/mach-u300/regulator.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
arch/arm/mach-u300/regulator.c +9 -3
@@ -71,19 +71,21 @@ static int __init __u300_init_boardpower(struct platform_device *pdev) regmap =syscon_node_to_regmap (syscon_np);if (IS_ERR (regmap)) {pr_crit ("U300: could not locate syscon regmap\n" ); -return PTR_ERR (regmap); + err =PTR_ERR (regmap); + goto error; } main_power_15 =regulator_get (&pdev->dev,"vana15" );if (IS_ERR (main_power_15)) {pr_err ("could not get vana15" ); -return PTR_ERR (main_power_15); + err =PTR_ERR (main_power_15); + goto error; } err =regulator_enable (main_power_15);if (err) {pr_err ("could not enable vana15\n" ); -return err; + goto error; }/*
@@ -99,8 +101,12 @@ static int __init __u300_init_boardpower(struct platform_device *pdev)/* Register globally exported PM poweroff hook */ pm_power_off = u300_pm_poweroff; +of_node_put (syscon_np);return 0 ; +error: +of_node_put (syscon_np); +return err; }static int __init s365_board_probe (struct platform_device *pdev)
Signature · 1 line
1.9.1
PATCH 4/7 bus: arm-cci: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- drivers/bus/arm-cci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/bus/arm-cci.c +4 -1
@@ -1912,9 +1912,12 @@ static int __cci_ace_get_port(struct device_node *dn, int type) cci_portn =of_parse_phandle (dn,"cci-control-port" ,0 );for (i =0 ; i < nb_cci_ports; i++) { ace_match = ports[i].type == type; -if (ace_match && cci_portn == ports[i].dn) +if (ace_match && cci_portn == ports[i].dn) { +of_node_put (cci_portn);return i; + } } +of_node_put (cci_portn);return -ENODEV ; }
Signature · 1 line
1.9.1
Re: [PATCH 4/7] bus: arm-cci: add missing of_node_put after calling of_parse_phandle
Quoted 6 lines · Peter Chen
of_node_putneeds to be called when the device node which is got fromof_parse_phandlehas finished using.Cc Will Deacon <[email protected]>Cc Suzuki K Poulose <[email protected]>Signed-off-by Peter Chen <[email protected]>
Thanks for the fix.
Quoted 9 lines
--- drivers/bus/arm-cci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/bus/arm-cci.c +0
-0
drivers/bus/arm-cci.c static int __cci_ace_get_port(struct device_node *dn, int type) · line 1920
Quoted 10 lines
drivers/bus/arm-cci.c +4
-1@@ -1912,9 +1912,12 @@ static int __cci_ace_get_port(struct device_node *dn, int type) cci_portn =of_parse_phandle (dn,"cci-control-port" ,0 );for (i =0 ; i < nb_cci_ports; i++) { ace_match = ports[i].type == type; -if (ace_match && cci_portn == ports[i].dn) +if (ace_match && cci_portn == ports[i].dn) { +of_node_put (cci_portn);return i; + } } +of_node_put (cci_portn);
nit: Could we please do some thing like this ?
if (ace_match && cci_portn == ports[i].dn) break; } of_node_put(cci_portn); return (i < nb_cci_ports) ? i : -ENODEV ;
Either way,
Re: [PATCH 4/7] bus: arm-cci: add missing of_node_put after calling of_parse_phandle
Quoted 38 lines · Suzuki K Poulose
Quoted 6 lines · Peter Chen
of_node_putneeds to be called when the device node which is got fromof_parse_phandlehas finished using.Cc Will Deacon <[email protected]>Cc Suzuki K Poulose <[email protected]>Signed-off-by Peter Chen <[email protected]>Thanks for the fix.
Quoted 9 lines
--- drivers/bus/arm-cci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/bus/arm-cci.c +0
-0drivers/bus/arm-cci.c static int __cci_ace_get_port(struct device_node *dn, int type) · line 1920
Quoted 10 lines
drivers/bus/arm-cci.c +4
-1@@ -1912,9 +1912,12 @@ static int __cci_ace_get_port(struct device_node *dn, int type) cci_portn =of_parse_phandle (dn,"cci-control-port" ,0 );for (i =0 ; i < nb_cci_ports; i++) { ace_match = ports[i].type == type; -if (ace_match && cci_portn == ports[i].dn) +if (ace_match && cci_portn == ports[i].dn) { +of_node_put (cci_portn);return i; + } } +of_node_put (cci_portn);nit: Could we please do some thing like this ?
if (ace_match && cci_portn == ports[i].dn) break; } of_node_put(cci_portn); return (i < nb_cci_ports) ? i : -ENODEV ;
Quoted 3 lines
Either way,
Reviewed-by Suzuki K Poulose <[email protected]>
Please route this via arm-soc once you've addressed Suzuki's comment.
Will
RE: [PATCH 4/7] bus: arm-cci: add missing of_node_put after calling of_parse_phandle
Quoted 39 lines · Suzuki K Poulose
Quoted 14 lines · Peter Chen
Quoted 6 lines
of_node_putneeds to be called when the device node which is got fromof_parse_phandlehas finished using.Cc Will Deacon <[email protected]>Cc Suzuki K Poulose <[email protected]>Signed-off-by Peter Chen <[email protected]>Thanks for the fix.
Quoted 4 lines
--- drivers/bus/arm-cci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)Quoted 5 lines
drivers/bus/arm-cci.c static int __cci_ace_get_port(struct device_node *dn,
Quoted 5 lines
drivers/bus/arm-cci.c index renamed from drivers/bus/arm-cci.c +0
-0a49b283..e7b0b8c 100644
drivers/bus/arm-cci.c +0
-0@@ -1912,9 +1912,12 @@ static int __cci_ace_get_port(struct device_node *dn,int type)
Quoted 16 lines
drivers/bus/arm-cci.c static int __cci_ace_get_port(struct device_node *dn, int type) · line 1920
Quoted 10 lines
drivers/bus/arm-cci.c +4
-1cci_portn =of_parse_phandle (dn,"cci-control-port" ,0 );for (i =0 ; i < nb_cci_ports; i++) { ace_match = ports[i].type == type; -if (ace_match && cci_portn == ports[i].dn) +if (ace_match && cci_portn == ports[i].dn) { +of_node_put (cci_portn);return i; + } } +of_node_put (cci_portn);nit: Could we please do some thing like this ?
if (ace_match && cci_portn == ports[i].dn) break; }
Quoted 9 lines
Quoted 6 lines
of_node_put(cci_portn); return (i < nb_cci_ports) ? i : -ENODEV ;Either way,
Reviewed-by Suzuki K Poulose <[email protected]>Please route this via arm-soc once you've addressed Suzuki's comment.
Hi Will, how to route patch via arm-soc?
Does it mean sending patch by adding arm at kernel.org at To or Cc list?
Peter
Re: [PATCH 4/7] bus: arm-cci: add missing of_node_put after calling of_parse_phandle
Quoted 5 lines · Peter Chen
Quoted 1 line
Please route this via arm-soc once you've addressed Suzuki's comment.
Hi Will, how to route patch via arm-soc?
Does it mean sending patch by adding arm at kernel.org at To or Cc list?
Yes. I just wanted to make it clear that I don't intend to pick this up (since I'd just send it to arm-soc anyway!).
Will
PATCH 5/7 bus: vexpress-config: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- drivers/bus/vexpress-config.c | 1 + 1 file changed, 1 insertion(+)
drivers/bus/vexpress-config.c +1 -0
@@ -178,6 +178,7 @@ static int vexpress_config_populate(struct device_node *node) parent =class_find_device (vexpress_config_class,NULL , bridge, vexpress_config_node_match); +of_node_put (bridge);if (WARN_ON (!parent))return -ENODEV ;
Signature · 1 line
1.9.1
Re: [PATCH 5/7] bus: vexpress-config: add missing of_node_put after calling of_parse_phandle
Quoted 7 lines · Peter Chen
of_node_putneeds to be called when the device node which is got fromof_parse_phandlehas finished using.Cc Liviu Dudau <[email protected]>Cc Sudeep Holla <[email protected]>Cc Lorenzo Pieralisi <[email protected]>Signed-off-by Peter Chen <[email protected]>
Quoted 25 lines
--- drivers/bus/vexpress-config.c | 1 + 1 file changed, 1 insertion(+)drivers/bus/vexpress-config.c +1
-0@@ -178,6 +178,7 @@ static int vexpress_config_populate(struct device_node *node) parent =class_find_device (vexpress_config_class,NULL , bridge, vexpress_config_node_match); +of_node_put (bridge);if (WARN_ON (!parent))return -ENODEV ;Signature · 7 lines
1.9.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 8 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
?\_(?)_/?PATCH 6/7 devfreq: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- drivers/devfreq/devfreq.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/devfreq/devfreq.c +2 -0
@@ -706,10 +706,12 @@ struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev, int index)if (devfreq->dev.parent && devfreq->dev.parent->of_node == node) {mutex_unlock (&devfreq_list_lock); +of_node_put (node);return devfreq; } }mutex_unlock (&devfreq_list_lock); +of_node_put (node);return ERR_PTR (-EPROBE_DEFER ); }
Signature · 1 line
1.9.1
PATCH 7/7 devfreq: exynos-bus: add missing of_node_put after calling of_parse_phandle
In reply to Peter Chenof_node_put needs to be called when the device node which is got from of_parse_phandle has finished using.
--- drivers/devfreq/exynos-bus.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/devfreq/exynos-bus.c +6 -3
@@ -383,7 +383,7 @@ err_clk:static int exynos_bus_probe (struct platform_device *pdev) {struct device *dev = &pdev->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;
Signature · 1 line
1.9.1
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 <[email protected]>:
Quoted 32 lines
of_node_putneeds to be called when the device node which is got fromof_parse_phandlehas finished using.Cc Chanwoo Choi <[email protected]>Cc MyungJoo Ham <[email protected]>Cc Kyungmin Park <[email protected]>Cc Kukjin Kim <[email protected]>Cc Krzysztof Kozlowski <[email protected]>Signed-off-by Peter Chen <[email protected]>--- drivers/devfreq/exynos-bus.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/devfreq/exynos-bus.c +2
-2@@ -383,7 +383,7 @@ err_clk:static int exynos_bus_probe (struct platform_device *pdev) {struct device *dev = &pdev->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 );
drivers/devfreq/exynos-bus.c static int exynos_bus_probe(struct platform_device *pdev) · line 427
Quoted 10 lines
drivers/devfreq/exynos-bus.c +4
-1+if (node) { +of_node_put (node); goto passive; - else + }else { ret =exynos_bus_parent_parse_of (np, bus); + }if (ret <0 ) goto err;
Regards,
Chanwoo Choi
A message that is not in the archive (sent off-list or not yet received): CGME20160701094923epcas1p164cc8773ec44a00dfc506a6192df3409@epcas1p1.samsung.com
MyungJoo Ham
maintainerRE: [PATCH 6/7] devfreq: add missing of_node_put after calling of_parse_phandle
Quoted 11 lines
--------- Original Message ---------
Sender : Peter Chen <[email protected]>
Date : 2016-07-01 18:49 (GMT+9)
Title : [PATCH 6/7] devfreq: add missingof_node_putafter callingof_parse_phandle
of_node_putneeds to be called when the device node which is got fromof_parse_phandlehas finished using.Cc MyungJoo Ham <[email protected]>Cc Kyungmin Park <[email protected]>Signed-off-by Peter Chen <[email protected]>
Thank you!
A message that is not in the archive (sent off-list or not yet received): CGME20160701094927epcas1p43f956ee3465f96e2f9c99b44c0f5b49d@epcas1p4.samsung.com
MyungJoo Ham
maintainerRE: [PATCH 7/7] devfreq: exynos-bus: add missing of_node_put after calling of_parse_phandle
Quoted 9 lines
--------- Original Message ---------
Sender : Peter Chen <[email protected]>
Date : 2016-07-01 18:49 (GMT+9)
Title : [PATCH 7/7] devfreq: exynos-bus: add missingof_node_putafter callingof_parse_phandle
of_node_putneeds to be called when the device node which is got fromof_parse_phandlehas finished using.
Quoted 6 lines
Cc Chanwoo Choi <[email protected]>Cc MyungJoo Ham <[email protected]>Cc Kyungmin Park <[email protected]>Cc Kukjin Kim <[email protected]>Cc Krzysztof Kozlowski <[email protected]>Signed-off-by Peter Chen <[email protected]>
With the change (build error fix) of the following added, (I'll update)
Cheers,
MyungJoo
Quoted 9 lines
--- drivers/devfreq/exynos-bus.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/devfreq/exynos-bus.c +0
-0
drivers/devfreq/exynos-bus.c err_clk: · line 386
Quoted 5 lines
drivers/devfreq/exynos-bus.c +1
-1@@ -383,7 +383,7 @@ err_clk:static int exynos_bus_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct device_node *np = dev->of_node; +struct device_node *np = dev->of_node, node;
+ struct device_node *np = dev->of_node, *node;
Quoted 3 lines
drivers/devfreq/exynos-bus.c +0
-0struct devfreq_dev_profile *profile;struct devfreq_simple_ondemand_data *ondemand_data;struct devfreq_passive_data *passive_data;
...