linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND 1/2] rtc: 88pm860x: Use of_get_child_by_name
@ 2014-04-23 12:29 Krzysztof Kozlowski
  2014-04-23 12:29 ` [PATCH RESEND 2/2] rtc: 88pm860x: Add missing of_node_put Krzysztof Kozlowski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2014-04-23 12:29 UTC (permalink / raw)
  To: Alessandro Zummo, rtc-linux, linux-kernel
  Cc: Andrew Morton, Haojian Zhuang, Jingoo Han, Sachin Kamat,
	Krzysztof Kozlowski

Use of_get_child_by_name to obtain reference to charger node instead of
of_find_node_by_name which can walk outside of the parent node.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
 drivers/rtc/rtc-88pm860x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-88pm860x.c b/drivers/rtc/rtc-88pm860x.c
index 816504846cdd..fb9e3c63b4ac 100644
--- a/drivers/rtc/rtc-88pm860x.c
+++ b/drivers/rtc/rtc-88pm860x.c
@@ -293,7 +293,7 @@ static int pm860x_rtc_dt_init(struct platform_device *pdev,
 	int ret;
 	if (!np)
 		return -ENODEV;
-	np = of_find_node_by_name(np, "rtc");
+	np = of_get_child_by_name(np, "rtc");
 	if (!np) {
 		dev_err(&pdev->dev, "failed to find rtc node\n");
 		return -ENODEV;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH RESEND 2/2] rtc: 88pm860x: Add missing of_node_put
  2014-04-23 12:29 [PATCH RESEND 1/2] rtc: 88pm860x: Use of_get_child_by_name Krzysztof Kozlowski
@ 2014-04-23 12:29 ` Krzysztof Kozlowski
  2014-04-23 13:29   ` Jingoo Han
  2014-04-23 12:57 ` [PATCH RESEND 1/2] rtc: 88pm860x: Use of_get_child_by_name Jingoo Han
  2014-04-23 20:14 ` Andrew Morton
  2 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2014-04-23 12:29 UTC (permalink / raw)
  To: Alessandro Zummo, rtc-linux, linux-kernel
  Cc: Andrew Morton, Haojian Zhuang, Jingoo Han, Sachin Kamat,
	Krzysztof Kozlowski

Add missing of_node_put to decrement the reference count.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
 drivers/rtc/rtc-88pm860x.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/rtc/rtc-88pm860x.c b/drivers/rtc/rtc-88pm860x.c
index fb9e3c63b4ac..0c6add1a38dc 100644
--- a/drivers/rtc/rtc-88pm860x.c
+++ b/drivers/rtc/rtc-88pm860x.c
@@ -301,6 +301,7 @@ static int pm860x_rtc_dt_init(struct platform_device *pdev,
 	ret = of_property_read_u32(np, "marvell,88pm860x-vrtc", &info->vrtc);
 	if (ret)
 		info->vrtc = 0;
+	of_node_put(np);
 	return 0;
 }
 #else
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH RESEND 1/2] rtc: 88pm860x: Use of_get_child_by_name
  2014-04-23 12:29 [PATCH RESEND 1/2] rtc: 88pm860x: Use of_get_child_by_name Krzysztof Kozlowski
  2014-04-23 12:29 ` [PATCH RESEND 2/2] rtc: 88pm860x: Add missing of_node_put Krzysztof Kozlowski
@ 2014-04-23 12:57 ` Jingoo Han
  2014-04-23 20:14 ` Andrew Morton
  2 siblings, 0 replies; 5+ messages in thread
From: Jingoo Han @ 2014-04-23 12:57 UTC (permalink / raw)
  To: 'Krzysztof Kozlowski'
  Cc: 'Alessandro Zummo',
	rtc-linux, linux-kernel, 'Andrew Morton',
	'Haojian Zhuang', 'Sachin Kamat',
	'Jingoo Han'

On Wednesday, April 23, 2014 9:29 PM, Krzysztof Kozlowski wrote:
> 
> Use of_get_child_by_name to obtain reference to charger node instead of
> of_find_node_by_name which can walk outside of the parent node.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Reviewed-by: Jingoo Han <jg1.han@samsung.com>

Best regards,
Jingoo Han

> ---
>  drivers/rtc/rtc-88pm860x.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/rtc/rtc-88pm860x.c b/drivers/rtc/rtc-88pm860x.c
> index 816504846cdd..fb9e3c63b4ac 100644
> --- a/drivers/rtc/rtc-88pm860x.c
> +++ b/drivers/rtc/rtc-88pm860x.c
> @@ -293,7 +293,7 @@ static int pm860x_rtc_dt_init(struct platform_device *pdev,
>  	int ret;
>  	if (!np)
>  		return -ENODEV;
> -	np = of_find_node_by_name(np, "rtc");
> +	np = of_get_child_by_name(np, "rtc");
>  	if (!np) {
>  		dev_err(&pdev->dev, "failed to find rtc node\n");
>  		return -ENODEV;
> --
> 1.9.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RESEND 2/2] rtc: 88pm860x: Add missing of_node_put
  2014-04-23 12:29 ` [PATCH RESEND 2/2] rtc: 88pm860x: Add missing of_node_put Krzysztof Kozlowski
@ 2014-04-23 13:29   ` Jingoo Han
  0 siblings, 0 replies; 5+ messages in thread
From: Jingoo Han @ 2014-04-23 13:29 UTC (permalink / raw)
  To: 'Krzysztof Kozlowski'
  Cc: 'Alessandro Zummo',
	rtc-linux, linux-kernel, 'Andrew Morton',
	'Haojian Zhuang', 'Sachin Kamat',
	'Jingoo Han'

On Wednesday, April 23, 2014 9:29 PM, Krzysztof Kozlowski wrote:
> 
> Add missing of_node_put to decrement the reference count.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Reviewed-by: Jingoo Han <jg1.han@samsung.com>

Best regards,
Jingoo Han

> ---
>  drivers/rtc/rtc-88pm860x.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/rtc/rtc-88pm860x.c b/drivers/rtc/rtc-88pm860x.c
> index fb9e3c63b4ac..0c6add1a38dc 100644
> --- a/drivers/rtc/rtc-88pm860x.c
> +++ b/drivers/rtc/rtc-88pm860x.c
> @@ -301,6 +301,7 @@ static int pm860x_rtc_dt_init(struct platform_device *pdev,
>  	ret = of_property_read_u32(np, "marvell,88pm860x-vrtc", &info->vrtc);
>  	if (ret)
>  		info->vrtc = 0;
> +	of_node_put(np);
>  	return 0;
>  }
>  #else
> --
> 1.9.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RESEND 1/2] rtc: 88pm860x: Use of_get_child_by_name
  2014-04-23 12:29 [PATCH RESEND 1/2] rtc: 88pm860x: Use of_get_child_by_name Krzysztof Kozlowski
  2014-04-23 12:29 ` [PATCH RESEND 2/2] rtc: 88pm860x: Add missing of_node_put Krzysztof Kozlowski
  2014-04-23 12:57 ` [PATCH RESEND 1/2] rtc: 88pm860x: Use of_get_child_by_name Jingoo Han
@ 2014-04-23 20:14 ` Andrew Morton
  2 siblings, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2014-04-23 20:14 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Alessandro Zummo, rtc-linux, linux-kernel, Haojian Zhuang,
	Jingoo Han, Sachin Kamat

On Wed, 23 Apr 2014 14:29:27 +0200 Krzysztof Kozlowski <k.kozlowski@samsung.com> wrote:

> Use of_get_child_by_name to obtain reference to charger node instead of
> of_find_node_by_name which can walk outside of the parent node.

When fixing bugs please always include a description of the end-user
visible effects of that bug so that others can work out which kernel
versions need the fix.

Thanks.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-04-23 20:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-23 12:29 [PATCH RESEND 1/2] rtc: 88pm860x: Use of_get_child_by_name Krzysztof Kozlowski
2014-04-23 12:29 ` [PATCH RESEND 2/2] rtc: 88pm860x: Add missing of_node_put Krzysztof Kozlowski
2014-04-23 13:29   ` Jingoo Han
2014-04-23 12:57 ` [PATCH RESEND 1/2] rtc: 88pm860x: Use of_get_child_by_name Jingoo Han
2014-04-23 20:14 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).