From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.251]) by ozlabs.org (Postfix) with ESMTP id 6F82EDDEDF for ; Fri, 11 Jan 2008 02:01:13 +1100 (EST) Received: by an-out-0708.google.com with SMTP id c37so156237anc.78 for ; Thu, 10 Jan 2008 07:01:10 -0800 (PST) Message-ID: Date: Thu, 10 Jan 2008 08:01:09 -0700 From: "Grant Likely" Sender: glikely@secretlab.ca To: "Stephen Rothwell" Subject: Re: [PATCH V3] [POWERPC] Add common clock setting routine mpc52xx_psc_set_clkdiv() In-Reply-To: <20080110181316.1213f273.sfr@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 References: <20080110052629.8853.52821.stgit@trillian.secretlab.ca> <20080110181316.1213f273.sfr@canb.auug.org.au> Cc: linuxppc-dev@ozlabs.org, dragos.carp@toptica.com List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 1/10/08, Stephen Rothwell wrote: > Hi Grant, > > On Wed, 09 Jan 2008 22:26:30 -0700 Grant Likely wrote: > > > > +mpc52xx_map_common_devices(void) > > { > > > + /* Clock Distribution Module, used by PSC clock setting function */ > > + np = of_find_matching_node(NULL, mpc52xx_cdm_ids); > > What happens if we find no node? Both of_iomap and of_put fail gracefully if np is NULL. IIRC that was done on purpose so this exact thing could be done. Users of mpc52xx_cdm (and the others done in this style) all check for mpc52xx_cdm being NULL before dereferencing. > > > + mpc52xx_cdm = of_iomap(np, 0); > > + of_node_put(np); > > } > > -- > Cheers, > Stephen Rothwell sfr@canb.auug.org.au > http://www.canb.auug.org.au/~sfr/ > > -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.