* [PATCH v3 1/1] clk: clk-qoriq: Replace of_node_put() with __free()
@ 2024-09-18 12:39 David Hunter
2024-10-09 23:01 ` Stephen Boyd
0 siblings, 1 reply; 2+ messages in thread
From: David Hunter @ 2024-09-18 12:39 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd
Cc: David Hunter, linux-clk, linux-kernel, javier.carrasco.cruz,
shuah
Use __free() to have automatic cleanup instead of calling of_node_put()
manually.
Compiled without errors or warnings.
Signed-off-by: David Hunter <david.hunter.linux@gmail.com>
---
The following commit has information on _free(device_node):
9448e55d032d99af8e23487f51a542d51b2f1a48
v3
- Changed subject
v2 - https://lore.kernel.org/all/20240821010739.15293-1-david.hunter.linux@gmail.com/
- Improved message body
- Use change log to give more information about __free()
v1 - https://lore.kernel.org/all/20240820013550.4906-1-david.hunter.linux@gmail.com/
---
drivers/clk/clk-qoriq.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index 4dcde305944c..a560edeb4b55 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -9,6 +9,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <dt-bindings/clock/fsl,qoriq-clockgen.h>
+#include <linux/cleanup.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/clkdev.h>
@@ -1065,11 +1066,8 @@ static void __init _clockgen_init(struct device_node *np, bool legacy);
static void __init legacy_init_clockgen(struct device_node *np)
{
if (!clockgen.node) {
- struct device_node *parent_np;
-
- parent_np = of_get_parent(np);
+ struct device_node *parent_np __free(device_node) = of_get_parent(np);
_clockgen_init(parent_np, true);
- of_node_put(parent_np);
}
}
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3 1/1] clk: clk-qoriq: Replace of_node_put() with __free()
2024-09-18 12:39 [PATCH v3 1/1] clk: clk-qoriq: Replace of_node_put() with __free() David Hunter
@ 2024-10-09 23:01 ` Stephen Boyd
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2024-10-09 23:01 UTC (permalink / raw)
To: David Hunter, Michael Turquette
Cc: David Hunter, linux-clk, linux-kernel, javier.carrasco.cruz,
shuah
Quoting David Hunter (2024-09-18 05:39:23)
> Use __free() to have automatic cleanup instead of calling of_node_put()
> manually.
>
> Compiled without errors or warnings.
>
> Signed-off-by: David Hunter <david.hunter.linux@gmail.com>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-10-09 23:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-18 12:39 [PATCH v3 1/1] clk: clk-qoriq: Replace of_node_put() with __free() David Hunter
2024-10-09 23:01 ` Stephen Boyd
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 NNTP newsgroup(s).