devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Use of of_parse_phandle()/of_node_put()
@ 2013-02-13  6:04 Kumar, Anil
  2013-02-13 15:52 ` Peter Ujfalusi
  0 siblings, 1 reply; 6+ messages in thread
From: Kumar, Anil @ 2013-02-13  6:04 UTC (permalink / raw)
  To: Ujfalusi, Peter
  Cc: Alsa Devel List,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Girdwood, Liam,
	jarkko.nikula-FVTvWyuFUl3QT0dZR+AlfA@public.gmane.org


[-- Attachment #1.1: Type: text/plain, Size: 939 bytes --]

Hi  Peter,

Just trying to understand.

In omap-twl4030.c file probe function :-

 dai_node = of_parse_phandle(node, "ti,mcbsp", 0);
                if (!dai_node) {
                        dev_err(&pdev->dev, "McBSP node is not provided\n");
                        return -EINVAL;
                }

Here  "of_parse_phandle()"  is used to get  "of_device" node pointer.
of_parse_phandle() suggest to use of_node_put()  on it when done.

It looks when code request for an "of_device" node, kernel  maintains "refcount" for this.
It check "refcount"  before giving pointer of of_device node and  WARN_ON()
in case of refcount  > 0 and increase it on success.

Should this code need to use of_node_put() on the requested "of_device" when done
so that this can be get  again ?

I am taking reference of Linux-next kernel.

I'm sorry if this question is very vague or  missing something.

Thanks,
Anil







[-- Attachment #1.2: Type: text/html, Size: 2342 bytes --]

[-- Attachment #2: Type: text/plain, Size: 192 bytes --]

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

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

end of thread, other threads:[~2013-02-14  9:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-13  6:04 Use of of_parse_phandle()/of_node_put() Kumar, Anil
2013-02-13 15:52 ` Peter Ujfalusi
2013-02-13 16:40   ` Anil Kumar
2013-02-13 17:02     ` Anil Kumar
2013-02-14  9:26       ` Peter Ujfalusi
2013-02-14  9:21     ` Peter Ujfalusi

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).