Re: [PATCH 2/3] of: irq: Do some clean up with use of __free()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 29, 2024 at 9:19 PM Zhang Zekun <zhangzekun11@xxxxxxxxxx> wrote:
>
> __free() provides a scoped of_node_put() functionality to put the
> device_node automatically, and we don't need to call of_node_put()
> directly. Let's simplify the code a bit with the use of __free().
>
> Signed-off-by: Zhang Zekun <zhangzekun11@xxxxxxxxxx>
> ---
>  drivers/of/irq.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/of/irq.c b/drivers/of/irq.c
> index 36351ad6115e..3291f1ffea49 100644
> --- a/drivers/of/irq.c
> +++ b/drivers/of/irq.c
> @@ -341,7 +341,7 @@ EXPORT_SYMBOL_GPL(of_irq_parse_raw);
>   */
>  int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_args *out_irq)
>  {
> -       struct device_node *p;
> +       struct device_node *p __free(device_node) = NULL;

It is desired that the declaration and (real) assignment be together.
See discussions when adding the device_node cleanup support.

Rob





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux