summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorDavid Hunter <david.hunter.linux@gmail.com>2024-07-09 10:35:53 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2024-11-15 10:35:58 +1100
commit4aa5cc1e0012f784bc7f637458e597564833b425 (patch)
tree5c593437aa918a57577ba56fd090465879de54ad /arch/powerpc
parente9d3270007b13acd34de4256970ffe457efc6c65 (diff)
downloadlinux-stable-4aa5cc1e0012f784bc7f637458e597564833b425.tar.gz
linux-stable-4aa5cc1e0012f784bc7f637458e597564833b425.tar.bz2
linux-stable-4aa5cc1e0012f784bc7f637458e597564833b425.zip
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 <david.hunter.linux@gmail.com> [mpe: Fix over-long line & change log wording] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://patch.msgid.link/20240709143553.117053-1-david.hunter.linux@gmail.com
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/82xx/km82xx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/82xx/km82xx.c b/arch/powerpc/platforms/82xx/km82xx.c
index c86da3f2b74b..99f0f0f41876 100644
--- a/arch/powerpc/platforms/82xx/km82xx.c
+++ b/arch/powerpc/platforms/82xx/km82xx.c
@@ -27,15 +27,15 @@
static void __init km82xx_pic_init(void)
{
- struct device_node *np = of_find_compatible_node(NULL, NULL,
- "fsl,pq2-pic");
+ struct device_node *np __free(device_node);
+ np = of_find_compatible_node(NULL, NULL, "fsl,pq2-pic");
+
if (!np) {
pr_err("PIC init: can not find cpm-pic node\n");
return;
}
cpm2_pic_init(np);
- of_node_put(np);
}
struct cpm_pin {