Re: [PATCH] pmdomain: rockchip: Simplify dropping OF node reference

From: Markus Elfring
Date: Fri Sep 13 2024 - 09:17:50 EST


> Drop OF node reference immediately after using it in
> syscon_node_to_regmap(), which is both simpler and typical/expected
> code pattern.

Dear Krzysztof,

I noticed also this contribution.
I found it easy to convert it also into the following small script variant
for the semantic patch language (Coccinelle software).


@adjustment@
expression e, x;
@@
+of_node_put(e);
if (...)
{
<+... when != e = x
- of_node_put(e);
...+>
}
-of_node_put(e);


58 patches were accordingly generated for source files of the software “Linux next-20240913”.
How would we like to tackle remaining update candidates according to similar transformation patterns?

Regards,
Markus