Re: [RFC/PATCH] of: of_find_node_by_name - stop dropping reference to 'from' node

From: Benjamin Herrenschmidt
Date: Thu Apr 21 2016 - 18:43:25 EST


On Thu, 2016-04-21 at 15:35 -0700, Frank Rowand wrote:
> No. It is correct for of_find_by_name() to call of_node_put() for
> the from argument. The callers should be fixed.

I would argue that if everybody makes the same mistake then our
interface is wrong. In that case I wrote it so I think I can plead
guilty to the mistake ;-)

In hindsight, but I don't have the stammina to do a tree-wide change, I
think we should have differenciated:

of_find_xxx which does *not* drop the reference

of_find_next_xxx which does

Cheers,
Ben.