From: Stephen Rothwell <sfr@canb.auug.org.au>
To: <Yuantian.Tang@freescale.com>
Cc: <grant.likely@secretlab.ca>,
devicetree-discuss@lists.ozlabs.org,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
rob.herring@calxeda.com
Subject: Re: [PATCH] of: remove the unnecessary of_node_put for of_parse_phandle_with_args()
Date: Wed, 10 Apr 2013 19:03:27 +1000 [thread overview]
Message-ID: <20130410190327.a70d4c3798509d664aef2f13@canb.auug.org.au> (raw)
In-Reply-To: <1365490569-32455-1-git-send-email-Yuantian.Tang@freescale.com>
[-- Attachment #1: Type: text/plain, Size: 1097 bytes --]
Hi,
On Tue, 9 Apr 2013 14:56:09 +0800 <Yuantian.Tang@freescale.com> wrote:
>
> From: Tang Yuantian <yuantian.tang@freescale.com>
>
> As the function itself says it is caller's responsibility to call the
> of_node_put(). So, remove it on success to keep the reference count
> correct.
>
> Signed-off-by: Tang Yuantian <Yuantian.Tang@freescale.com>
> ---
> drivers/of/base.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 321d3ef..e8b4c28 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -1168,9 +1168,6 @@ static int __of_parse_phandle_with_args(const struct device_node *np,
> out_args->args[i] = be32_to_cpup(list++);
> }
>
> - /* Found it! return success */
> - if (node)
> - of_node_put(node);
Actually, if out_args is NULL, you should do the of_node_put(node), so
probably the correct fix is to add an "else" before the above "if" (and
move the comment).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-04-10 9:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-09 6:56 Yuantian.Tang
2013-04-10 9:03 ` Stephen Rothwell [this message]
2013-04-10 9:06 ` Tang Yuantian-B29983
2013-04-10 11:09 ` Stephen Rothwell
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=20130410190327.a70d4c3798509d664aef2f13@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=Yuantian.Tang@freescale.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=rob.herring@calxeda.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
all inboxes | Powered by JetHome®