Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: clk-qoriq: Replace of_node_put() with __free()

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>
Link: https://lore.kernel.org/r/20240918123925.41511-1-david.hunter.linux@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

David Hunter and committed by
Stephen Boyd
8fcad5ff 21291491

+2 -4
+2 -4
drivers/clk/clk-qoriq.c
··· 9 9 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 10 10 11 11 #include <dt-bindings/clock/fsl,qoriq-clockgen.h> 12 + #include <linux/cleanup.h> 12 13 #include <linux/clk.h> 13 14 #include <linux/clk-provider.h> 14 15 #include <linux/clkdev.h> ··· 1066 1065 static void __init legacy_init_clockgen(struct device_node *np) 1067 1066 { 1068 1067 if (!clockgen.node) { 1069 - struct device_node *parent_np; 1070 - 1071 - parent_np = of_get_parent(np); 1068 + struct device_node *parent_np __free(device_node) = of_get_parent(np); 1072 1069 _clockgen_init(parent_np, true); 1073 - of_node_put(parent_np); 1074 1070 } 1075 1071 } 1076 1072