Thread (8 messages) 8 messages, 3 authors, 2024-09-12

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

From: Rob Herring <robh@kernel.org>
Date: 2024-08-30 14:35:04

On Thu, Aug 29, 2024 at 9:19 PM Zhang Zekun [off-list ref] wrote:
quoted hunk ↗ jump to hunk
__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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help