From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King - ARM Linux Subject: Re: [PATCH 1/2] clk: Fix error handling in fixed clock hardware type register fn Date: Wed, 21 Mar 2012 09:07:31 +0000 Message-ID: <20120321090730.GR15988@n2100.arm.linux.org.uk> References: <1332214706-675-1-git-send-email-skannan@codeaurora.org> <20120320071957.GH3852@pengutronix.de> <348585ed29fb3ff171267c03658e6c0d.squirrel@www.codeaurora.org> <4F693DD8.7070305@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from caramon.arm.linux.org.uk ([78.32.30.218]:36712 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756849Ab2CUJIM (ORCPT ); Wed, 21 Mar 2012 05:08:12 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: "Turquette, Mike" Cc: Saravana Kannan , Sascha Hauer , Andrew Lunn , Grant Likely , Jamie Iles , Jeremy Kerr , Magnus Damm , Deepak Saxena , linux-arm-kernel@lists.infradead.org, Arnd Bergman , linux-arm-msm@vger.kernel.org, Rob Herring , Thomas Gleixner , Richard Zhao , Shawn Guo , Paul Walmsley , Linus Walleij , Mark Brown , Stephen Boyd , linux-kernel@vger.kernel.org, Amit Kucheria On Tue, Mar 20, 2012 at 10:45:36PM -0700, Turquette, Mike wrote: > IIRC, that discussion was with respect to the .parent member of struct > clk. It was decided that having .parent = NULL does not imply that a > clock is a root clock, but instead we rely on the CLK_IS_ROOT flag. I > can't think of any other instance where a NULL clk when returned from > a registration function would be useful. No. What I've been saying is that in _drivers_ which use clk_get(), the error range is defined by IS_ERR(clk). Every other value of clk must be assumed by the driver to be valid, no ifs or buts. What the clk API assumes about struct clk is its own business. If it wishes to interpret the NULL clk in a specific way, that's its business to do so. But it's still not the drivers business to then go and interpret NULL as being any different from any other valid clock. This is part of the clk API contract, which is as I said in the first paragraph, and I keep on saying. I'm not sure what's so difficult about this.