mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
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
This commit is contained in:
parent
e9d3270007
commit
4aa5cc1e00
|
|
@ -27,15 +27,15 @@
|
||||||
|
|
||||||
static void __init km82xx_pic_init(void)
|
static void __init km82xx_pic_init(void)
|
||||||
{
|
{
|
||||||
struct device_node *np = of_find_compatible_node(NULL, NULL,
|
struct device_node *np __free(device_node);
|
||||||
"fsl,pq2-pic");
|
np = of_find_compatible_node(NULL, NULL, "fsl,pq2-pic");
|
||||||
|
|
||||||
if (!np) {
|
if (!np) {
|
||||||
pr_err("PIC init: can not find cpm-pic node\n");
|
pr_err("PIC init: can not find cpm-pic node\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cpm2_pic_init(np);
|
cpm2_pic_init(np);
|
||||||
of_node_put(np);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct cpm_pin {
|
struct cpm_pin {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user