devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Usage of for_each_child_of_node()
@ 2013-10-12 20:54 Guenter Roeck
       [not found] ` <5259B6F8.3070701-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Guenter Roeck @ 2013-10-12 20:54 UTC (permalink / raw)
  To: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
  Cc: Grant Likely, Rob Herring,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ 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
     [not found] ` <5259B6F8.3070701-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-10-13  3:15   ` Rob Herring
2013-10-23  7:10     ` Thierry Reding
     [not found]       ` <20131023071006.GA7708-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
2013-10-23 16:16         ` Guenter Roeck
     [not found]           ` <20131023161644.GB20675-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-10-24  7:50             ` Thierry Reding
2013-10-24 13:31               ` Guenter Roeck
     [not found]                 ` <52692129.3070207-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
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;
as well as URLs for NNTP newsgroup(s).