Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753720AbcDUWnX (ORCPT ); Thu, 21 Apr 2016 18:43:23 -0400 Received: from gate.crashing.org ([63.228.1.57]:53722 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753256AbcDUWnW (ORCPT ); Thu, 21 Apr 2016 18:43:22 -0400 Message-ID: <1461278543.3135.16.camel@kernel.crashing.org> Subject: Re: [RFC/PATCH] of: of_find_node_by_name - stop dropping reference to 'from' node From: Benjamin Herrenschmidt To: frowand.list@gmail.com, Dmitry Torokhov Cc: Rob Herring , Tony Lindgren , Scott Wood , Kumar Gala , Paul Mackerras , Arnd Bergmann , Grant Likely , Jingoo Han , Lee Jones , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , "H. Nikolaus Schaller" , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Date: Fri, 22 Apr 2016 08:42:23 +1000 In-Reply-To: <571955A4.7080706@gmail.com> References: <20160419170540.GA8327@dtor-ws> <571955A4.7080706@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2 (3.18.5.2-1.fc23) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 539 Lines: 17 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.