[PATCH 8/9 V3] Add documentation for the new DTS language.

David Gibson david at gibson.dropbear.id.au
Tue Mar 2 12:22:55 EST 2010


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


More information about the devicetree-discuss mailing list