[PATCH] phy: amlogic: phy-meson-axg-mipi-pcie-analog: Hold reference returned by of_get_parent()

Vinod Koul vkoul at kernel.org
Tue Sep 13 06:55:53 PDT 2022


On 05-09-22, 15:21, Liang He wrote:
> 
> 
> 
> At 2022-09-02 23:41:14, "Vinod Koul" <vkoul at kernel.org> wrote:
> >On 05-07-22, 10:15, Liang He wrote:
> >> We should hold the reference returned by of_get_parent() and use it
> >> to call of_node_put() for reference balance.
> >
> >And why should we hold and drop reference?
> 
> >
> Hi, Vinod Koul,
> 
> 
> Thanks very much for your review.
> 
> 
> As the of_get_parent() will increase the refcount of the node->parent  and the reference will be discarded 
> so we should hold the reference , with which we can decrease the refcount.

Right, that is correct explanation
> 
> 
> If there is any misunderstanding about the of_get_parent() API, please correct me.

Nope, just that this explanation is missing from the log...

Please add...

-- 
~Vinod



More information about the linux-phy mailing list