public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Usage of for_each_child_of_node()
@ 2013-10-12 20:54 Guenter Roeck
  2013-10-13  3:15 ` Rob Herring
  0 siblings, 1 reply; 7+ messages in thread
From: Guenter Roeck @ 2013-10-12 20:54 UTC (permalink / raw)
  To: devicetree@vger.kernel.org
  Cc: Grant Likely, Rob Herring, linux-kernel@vger.kernel.org

Hi all,

for_each_child_of_node() and similar functions increase the refcount
on each returned node and expect the caller to release the node by
calling of_node_put() when done.

Looking through the kernel code, it appears this is hardly ever done,
if at all. Some code even calls of_node_get() on returned nodes again.

I guess this doesn't matter in cases where devicetree is a static entity.
However, this is not (or no longer) the case with devicetree overlays,
or more generically in cases where devicetree nodes are added and
removed dynamically.

Fundamental question: Would patches to fix this problem be accepted upstream ?

Or, of course, stepping a bit back: Am I missing something essential ?

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-10-24 14:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-12 20:54 Usage of for_each_child_of_node() Guenter Roeck
2013-10-13  3:15 ` Rob Herring
2013-10-23  7:10   ` Thierry Reding
2013-10-23 16:16     ` Guenter Roeck
2013-10-24  7:50       ` Thierry Reding
2013-10-24 13:31         ` Guenter Roeck
2013-10-24 14:21           ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox