[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f87bfbb1-b80f-46a5-be85-058a406de99d@gmail.com>
Date: Fri, 3 May 2024 21:53:19 +0530
From: R Sundar <prosunofficial@...il.com>
To: p.zabel@...gutronix.de, airlied@...il.com, daniel@...ll.ch
Cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
skhan@...uxfoundation.org, javier.carrasco.cruz@...il.com,
Julia Lawall <julia.lawall@...ia.fr>
Subject: Re: [PATCH linux-next] gpu:ipu-v3:pre: replace of_node_put() with
__free
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@...ia.fr>
> Signed-off-by: R Sundar <prosunofficial@...il.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
Powered by blists - more mailing lists