From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jon Loeliger Subject: Re: dtc: Handle linux,phandle properties which self-reference Date: Mon, 17 Nov 2008 14:12:18 -0600 Message-ID: References: <20081107014944.GI6692@yookeroo.seuss> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-reply-to: <20081107014944.GI6692-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-mnsaURCQ41sdnm+yROfE0A@public.gmane.org Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-mnsaURCQ41sdnm+yROfE0A@public.gmane.org To: David Gibson Cc: Scott Wood , devicetree-discuss List-Id: devicetree@vger.kernel.org > Currently, dtc will generate phandles for nodes which are referenced > elsewhere in the tree. phandles can also be explicitly assigned by > defining the linux,phandle property. However, there is no way, > currently to tell dtc to generate a phandle for a node if it is not > referenced elsewhere. This is inconvenient when it's expected that > later processing on the flat tree might add nodes which _will_ > the node in question. > > One way one might attempt to do this is with the construct: > mynode: mynode { > linux,phandle = <&mynode>; > /* ... */ > }; > Though it's a trifle odd, there's really only one sensible meaning > which can be assigned to this construct: allocate a unique phandle to > "mynode" and put that in its linux,phandle property (as always). > > Currently, however, dtc will choke on this self-reference. This patch > corrects this, making the construct above give the expected results. > It also ensures a more meaningful error message is given if you > attempt to process the nonsensical construct: > mynode: mynode { > linux,phandle = <&someothernode>; > /* ... */ > }; > > The 'references' testcase is extended to cover this case, as well. > > Signed-off-by: David Gibson Applied. Thanks, jdl