From: Tony Lindgren <tony@atomide.com>
To: Liang He <windhl@126.com>
Cc: linux@armlinux.org.uk, linux-omap@vger.kernel.org
Subject: Re: [PATCH 3/3] arm: omap2: prm_common: Add the refcount for new reference creation
Date: Mon, 4 Jul 2022 10:47:01 +0300 [thread overview]
Message-ID: <YsKa9czyRpYa7UDA@atomide.com> (raw)
In-Reply-To: <20220701112649.233322-3-windhl@126.com>
* Liang He <windhl@126.com> [220701 14:22]:
> In omap2_prm_base_init(), for_each_matching_node_and_match() can
> automatically increase and decrease the refcounting. However, a
> new reference is escaped out into 'data->np', so we need to use
> of_node_put() for the old reference and use of_node_get() for the
> new one.
>
> Signed-off-by: Liang He <windhl@126.com>
> ---
> arch/arm/mach-omap2/prm_common.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
> index fb2d48cfe756..bed151e3f165 100644
> --- a/arch/arm/mach-omap2/prm_common.c
> +++ b/arch/arm/mach-omap2/prm_common.c
> @@ -764,7 +764,8 @@ int __init omap2_prm_base_init(void)
> prm_base.pa = res.start + data->offset;
> }
>
> - data->np = np;
> + of_node_put(data->np);
> + data->np = of_node_get(np);
>
> if (data->init)
> data->init(data);
Hmm so I don't get how this improves things? Don't we enable with
the same refcounting?
Regards,
Tony
next prev parent reply other threads:[~2022-07-04 7:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-01 11:26 [PATCH 1/3] crypto: nx: Hold the reference returned by of_find_compatible_node Liang He
2022-07-01 11:26 ` [PATCH 2/3] arm: omap2: pm33xx-core: Fix missing of_node_put() in amx3_idle_init() Liang He
2022-07-01 11:26 ` [PATCH 3/3] arm: omap2: prm_common: Add the refcount for new reference creation Liang He
2022-07-04 7:47 ` Tony Lindgren [this message]
2022-07-04 7:56 ` Liang He
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=YsKa9czyRpYa7UDA@atomide.com \
--to=tony@atomide.com \
--cc=linux-omap@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=windhl@126.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.