From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: [PATCH 8/9 V3] Add documentation for the new DTS language. Date: Tue, 2 Mar 2010 12:22:55 +1100 Message-ID: <20100302012255.GH23435@yookeroo> References: <1222460748-20127-9-git-send-email-jdl@jdl.com> <20080930145537.GJ18313@secretlab.ca> <20081001034656.GF30810@yookeroo.seuss> <20100222013004.GM29038@yookeroo> <9696D7A991D0824DBA8DFAC74A9C5FA305B2021A@az33exm25.fsl.freescale.net> <4288fc0b-79a4-42fd-9e77-573dbad79210@SG2EHSMHS004.ehs.local> <4B8C44C8.6000105@freescale.com> <7c070166-6cd5-48e4-ab8e-cb062e3dbb00@SG2EHSMHS008.ehs.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <7c070166-6cd5-48e4-ab8e-cb062e3dbb00-RaUQJvECHiusiP+nND6G/7jjLBE8jN/0@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: Stephen Neuendorffer Cc: Wood Scott-B07421 , devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org, Yoder Stuart-B08248 , Scott Wood , Jeremy Kerr , John Williams List-Id: devicetree@vger.kernel.org On Mon, Mar 01, 2010 at 02:56:41PM -0800, Stephen Neuendorffer wrote: > > >> That raises the question of whether it's legal to delete things > that aren't > > >> there. > > > > > > It isn't currently, which seems sane to me. > > > > > >> There may be cases where a dts fragment A doesn't know whether > > >> fragment B will have defined something, and fragment A wants to > make sure it > > >> ends up undefined one way or another. > > > > > > Later fragments should always override earlier ones. So if A is > > > defined before B, then B can override anything that A does. > > > > Sorry for the confusing enumeration -- A comes after B. > > > > To put it in more concrete terms, suppose you're writing an update > wrapper > > around the autogenerated FPGA dts. In some configurations a given > node/property > > will be autogenerated, in others not -- but you want the wrapper to > make sure > > it's gone, because it doesn't work with the system the FPGA is > connected to. > > > > If it's an error to delete something that doesn't exist, you'd have to > have two > > update trees, first adding/replacing the thing in question to make > sure it's > > there, and the second to delete it. > > > > Allowing such an operation also lines up better with your suggestion > to think of > > it as masking, rather than deleting. > > FWIW, I tend to agree with Scott... I find it more natural to think > of deletion as a well-defined total function, rather than as an > operation which may fail. I tend to agree, although I'm not sure that "total function" is quite the right term. I think the approach that makes the most sense in the context of this "stack of overlays" approach, is to think of "non-existent" as a special type of value (which is different from merely empty, of course). So, deletion is overriding a node or property's existing value with "non-existent". -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson