pinctrl: imx1-core: add missing of_node_put
authorVaishali Thakkar <vthakkar1994@gmail.com>
Sun, 15 Nov 2015 04:04:23 +0000 (09:34 +0530)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 17 Nov 2015 14:01:37 +0000 (15:01 +0100)
commit0563df2ce72b5d21217223e73f56ecfcacffb639
treee24f5ab033e2772599f206f48fa6a2126535d90c
parent932cb839628e9b4660672e93280a41da044601e1
pinctrl: imx1-core: add missing of_node_put

for_each_child_of_node performs an of_node_get on each iteration,
so of_node_put is required on break out of the loop.

This is done using Coccinelle. And semantic patch used for this is
as follows:

@@
expression root,e;
local idexpression child;
@@

 for_each_child_of_node(root, child) {
   ... when != of_node_put(child)
       when != e = child
(
   return child;
|
+  of_node_put(child);
?  return ...;
)
   ...
 }

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/freescale/pinctrl-imx1-core.c