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






_______________________________________________
devicetree-discuss mailing list
[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss

Reply via email to