From: R Sundar <prosunofficial@gmail.com>
To: p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
skhan@linuxfoundation.org, javier.carrasco.cruz@gmail.com,
Julia Lawall <julia.lawall@inria.fr>
Subject: Re: [PATCH linux-next] gpu:ipu-v3:pre: replace of_node_put() with __free
Date: Fri, 3 May 2024 21:53:19 +0530 [thread overview]
Message-ID: <f87bfbb1-b80f-46a5-be85-058a406de99d@gmail.com> (raw)
In-Reply-To: <20240427045024.7083-1-prosunofficial@gmail.com>
On 27/04/24 10:20, R Sundar wrote:
> use the new cleanup magic to replace of_node_put() with
> __free(device_node) marking to auto release when they get out of scope.
>
> Suggested-by: Julia Lawall <julia.lawall@inria.fr>
> Signed-off-by: R Sundar <prosunofficial@gmail.com>
> ---
> drivers/gpu/ipu-v3/ipu-pre.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/ipu-v3/ipu-pre.c b/drivers/gpu/ipu-v3/ipu-pre.c
> index aef984a43190..95830cf8fa3e 100644
> --- a/drivers/gpu/ipu-v3/ipu-pre.c
> +++ b/drivers/gpu/ipu-v3/ipu-pre.c
> @@ -113,8 +113,8 @@ int ipu_pre_get_available_count(void)
> struct ipu_pre *
> ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index)
> {
> - struct device_node *pre_node = of_parse_phandle(dev->of_node,
> - name, index);
> + struct device_node *pre_node __free(device_node) =
> + of_parse_phandle(dev->of_node, name, index);
> struct ipu_pre *pre;
>
> mutex_lock(&ipu_pre_list_mutex);
> @@ -123,14 +123,11 @@ ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index)
> mutex_unlock(&ipu_pre_list_mutex);
> device_link_add(dev, pre->dev,
> DL_FLAG_AUTOREMOVE_CONSUMER);
> - of_node_put(pre_node);
> return pre;
> }
> }
> mutex_unlock(&ipu_pre_list_mutex);
>
> - of_node_put(pre_node);
> -
> return NULL;
> }
>
Hi,
Any feedback on this patch.
Thanks,
Sundar
prev parent reply other threads:[~2024-05-03 16:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-27 4:50 [PATCH linux-next] gpu:ipu-v3:pre: replace of_node_put() with __free R Sundar
2024-05-03 16:23 ` R Sundar [this message]
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=f87bfbb1-b80f-46a5-be85-058a406de99d@gmail.com \
--to=prosunofficial@gmail.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=javier.carrasco.cruz@gmail.com \
--cc=julia.lawall@inria.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=skhan@linuxfoundation.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).