All of lore.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: Guodong Xu <guodong.xu@linaro.org>
Cc: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	Support Opensource <support.opensource@diasemi.com>
Subject: Re: [PATCH] regulator: remove unnecessary of_node_get() to parent
Date: Wed, 10 Sep 2014 17:51:00 +0800	[thread overview]
Message-ID: <CAFRkauCCv71fPnCAiqzaSVtn=3cWUr1vzgyyOAEnUoX7S_4RGg@mail.gmail.com> (raw)
In-Reply-To: <541018A0.6070403@linaro.org>

2014-09-10 17:23 GMT+08:00 Guodong Xu <guodong.xu@linaro.org>:
>
>
> On 09/10/2014 12:23 PM, Axel Lin wrote:
>> 2014-09-10 12:20 GMT+08:00 Axel Lin <axel.lin@ingics.com>:
>>> 2014-09-10 11:50 GMT+08:00 Guodong Xu <guodong.xu@linaro.org>:
>>>> These of_node_get() were added to balance refcount decrements inside of
>>>> of_find_node_by_name().
>>>> See: commit c92f5dd2c42f ("regulator: Add missing of_node_put()")
>>>>
>>>> However of_find_node_by_name() was then replaced by of_get_child_by_name(),
>>>> which doesn't call of_node_put() against its input parameter.
>>>>
>>>> So, need to remove these unnecessary of_node_get() calls.
>>>
>>> The of_node_get() and of_node_put() is a pair.
>>> You need to either keep both or remove both.
>>>
>>>
>>> BTW,
>>> I think either the comment of of_get_child_by_name() needs fix or the
>>> implementation
>>> needs fix. The implementation does not increment refcount.
>>
>> Ah, I see the of_node_get() and of_node_put() in __of_get_next_child.
>> So of_get_child_by_name() is correct.(both comment and implementation)
>>
>
> That's right. You only need to call of_node_put() once on the node
> of_get_child_by_name() returns. That's why I submit this patch to remove
> of_node_get() _before_ calling to of_get_child_by_name().

Reviewed-by: Axel Lin <axel.lin@ingics.com>

Thanks,
Axel

WARNING: multiple messages have this Message-ID (diff)
From: axel.lin@ingics.com (Axel Lin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] regulator: remove unnecessary of_node_get() to parent
Date: Wed, 10 Sep 2014 17:51:00 +0800	[thread overview]
Message-ID: <CAFRkauCCv71fPnCAiqzaSVtn=3cWUr1vzgyyOAEnUoX7S_4RGg@mail.gmail.com> (raw)
In-Reply-To: <541018A0.6070403@linaro.org>

2014-09-10 17:23 GMT+08:00 Guodong Xu <guodong.xu@linaro.org>:
>
>
> On 09/10/2014 12:23 PM, Axel Lin wrote:
>> 2014-09-10 12:20 GMT+08:00 Axel Lin <axel.lin@ingics.com>:
>>> 2014-09-10 11:50 GMT+08:00 Guodong Xu <guodong.xu@linaro.org>:
>>>> These of_node_get() were added to balance refcount decrements inside of
>>>> of_find_node_by_name().
>>>> See: commit c92f5dd2c42f ("regulator: Add missing of_node_put()")
>>>>
>>>> However of_find_node_by_name() was then replaced by of_get_child_by_name(),
>>>> which doesn't call of_node_put() against its input parameter.
>>>>
>>>> So, need to remove these unnecessary of_node_get() calls.
>>>
>>> The of_node_get() and of_node_put() is a pair.
>>> You need to either keep both or remove both.
>>>
>>>
>>> BTW,
>>> I think either the comment of of_get_child_by_name() needs fix or the
>>> implementation
>>> needs fix. The implementation does not increment refcount.
>>
>> Ah, I see the of_node_get() and of_node_put() in __of_get_next_child.
>> So of_get_child_by_name() is correct.(both comment and implementation)
>>
>
> That's right. You only need to call of_node_put() once on the node
> of_get_child_by_name() returns. That's why I submit this patch to remove
> of_node_get() _before_ calling to of_get_child_by_name().

Reviewed-by: Axel Lin <axel.lin@ingics.com>

Thanks,
Axel

  reply	other threads:[~2014-09-10  9:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-10  3:50 [PATCH] regulator: remove unnecessary of_node_get() to parent Guodong Xu
2014-09-10  3:50 ` Guodong Xu
2014-09-10  4:20 ` Axel Lin
2014-09-10  4:20   ` Axel Lin
2014-09-10  4:23   ` Axel Lin
2014-09-10  4:23     ` Axel Lin
2014-09-10  9:23     ` Guodong Xu
2014-09-10  9:23       ` Guodong Xu
2014-09-10  9:51       ` Axel Lin [this message]
2014-09-10  9:51         ` Axel Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFRkauCCv71fPnCAiqzaSVtn=3cWUr1vzgyyOAEnUoX7S_4RGg@mail.gmail.com' \
    --to=axel.lin@ingics.com \
    --cc=broonie@kernel.org \
    --cc=guodong.xu@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=support.opensource@diasemi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.