From: Guodong Xu <guodong.xu@linaro.org>
To: Axel Lin <axel.lin@ingics.com>
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:23:44 +0800 [thread overview]
Message-ID: <541018A0.6070403@linaro.org> (raw)
In-Reply-To: <CAFRkauDnp0pEEFkzvUoD8i4Up5DaMJDM26uGihah86FxsO7Rsw@mail.gmail.com>
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().
-Guodong
next prev parent reply other threads:[~2014-09-10 9:23 UTC|newest]
Thread overview: 5+ 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 4:20 ` Axel Lin
2014-09-10 4:23 ` Axel Lin
2014-09-10 9:23 ` Guodong Xu [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=541018A0.6070403@linaro.org \
--to=guodong.xu@linaro.org \
--cc=axel.lin@ingics.com \
--cc=broonie@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox