From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Turquette, Mike" Subject: Re: [PATCH 1/2] clk: Fix error handling in fixed clock hardware type register fn Date: Wed, 21 Mar 2012 12:56:21 -0700 Message-ID: References: <1332214706-675-1-git-send-email-skannan@codeaurora.org> <20120320071957.GH3852@pengutronix.de> <348585ed29fb3ff171267c03658e6c0d.squirrel@www.codeaurora.org> <4F693DD8.7070305@codeaurora.org> <20120321090730.GR15988@n2100.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from na3sys009aog137.obsmtp.com ([74.125.149.18]:49850 "EHLO psmtp.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757313Ab2CUT4u convert rfc822-to-8bit (ORCPT ); Wed, 21 Mar 2012 15:56:50 -0400 Received: by eeke49 with SMTP id e49so550756eek.7 for ; Wed, 21 Mar 2012 12:56:45 -0700 (PDT) In-Reply-To: <20120321090730.GR15988@n2100.arm.linux.org.uk> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Russell King - ARM Linux 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 Wed, Mar 21, 2012 at 2:07 AM, Russell King - ARM Linux wrote: > On Tue, Mar 20, 2012 at 10:45:36PM -0700, Turquette, Mike wrote: >> IIRC, that discussion was with respect to the .parent member of stru= ct >> clk. =A0It was decided that having .parent =3D NULL does not imply t= hat a >> clock is a root clock, but instead we rely on the CLK_IS_ROOT flag. = =A0I >> can't think of any other instance where a NULL clk when returned fro= m >> a registration function would be useful. > > No. =A0What I've been saying is that in _drivers_ which use clk_get()= , > the error range is defined by IS_ERR(clk). =A0Every other value of > clk must be assumed by the driver to be valid, no ifs or buts. Drivers certainly might make calls to clk_register_foo, despite it being outside of the traditional clock api. For the sake of consistency I'll convert the clk_register_foo functions to return error codes. Regards, Mike From mboxrd@z Thu Jan 1 00:00:00 1970 From: mturquette@ti.com (Turquette, Mike) Date: Wed, 21 Mar 2012 12:56:21 -0700 Subject: [PATCH 1/2] clk: Fix error handling in fixed clock hardware type register fn In-Reply-To: <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> <20120321090730.GR15988@n2100.arm.linux.org.uk> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, Mar 21, 2012 at 2:07 AM, Russell King - ARM Linux wrote: > 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. Drivers certainly might make calls to clk_register_foo, despite it being outside of the traditional clock api. For the sake of consistency I'll convert the clk_register_foo functions to return error codes. Regards, Mike