Skip to content

Commit 8fcad5f

Browse files
David Hunterbebarino
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 2129149 commit 8fcad5f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/clk/clk-qoriq.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
1010

1111
#include <dt-bindings/clock/fsl,qoriq-clockgen.h>
12+
#include <linux/cleanup.h>
1213
#include <linux/clk.h>
1314
#include <linux/clk-provider.h>
1415
#include <linux/clkdev.h>
@@ -1065,11 +1066,8 @@ static void __init _clockgen_init(struct device_node *np, bool legacy);
10651066
static void __init legacy_init_clockgen(struct device_node *np)
10661067
{
10671068
if (!clockgen.node) {
1068-
struct device_node *parent_np;
1069-
1070-
parent_np = of_get_parent(np);
1069+
struct device_node *parent_np __free(device_node) = of_get_parent(np);
10711070
_clockgen_init(parent_np, true);
1072-
of_node_put(parent_np);
10731071
}
10741072
}
10751073

0 commit comments

Comments
 (0)