Skip to content

Commit 4aa5cc1

Browse files
David Huntermpe
authored andcommitted
powerpc-km82xx.c: replace of_node_put() with __free
The use of the __free macro allows the cleanup to be based on scope instead of on another function called later. This makes the cleanup automatic and less susceptible to errors later. Signed-off-by: David Hunter <[email protected]> [mpe: Fix over-long line & change log wording] Signed-off-by: Michael Ellerman <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent e9d3270 commit 4aa5cc1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/powerpc/platforms/82xx/km82xx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727

2828
static void __init km82xx_pic_init(void)
2929
{
30-
struct device_node *np = of_find_compatible_node(NULL, NULL,
31-
"fsl,pq2-pic");
30+
struct device_node *np __free(device_node);
31+
np = of_find_compatible_node(NULL, NULL, "fsl,pq2-pic");
32+
3233
if (!np) {
3334
pr_err("PIC init: can not find cpm-pic node\n");
3435
return;
3536
}
3637

3738
cpm2_pic_init(np);
38-
of_node_put(np);
3939
}
4040

4141
struct cpm_pin {

0 commit comments

Comments
 (0)