[PATCH] Implements new features for updating existing device tree nodes.

Scott Wood scottwood at freescale.com
Tue Oct 19 04:42:20 EST 2010


On Mon, 18 Oct 2010 10:01:15 -0600
Grant Likely <grant.likely at secretlab.ca> wrote:

> On Mon, Oct 18, 2010 at 11:11:35AM +1100, David Gibson wrote:
> > On Sat, Oct 16, 2010 at 12:32:17PM -0600, Grant Likely wrote:
> > > Plus I want the ability to logically group related changes.  ie.
> > > delete a device and add a device to the same bus at the same time.
> > > Or delete a phy node, add a replacement phy node at a different
> > > address, and update the ethernet phy-device phandle in the same
> > > block.
> > 
> > Hrm, I really don't think this is a good argument.  You're conflating
> > the grouping of logically related changes with the tree structure
> > which I think is a mistake.  Putting the changes in the same file
> > and/or adjusting your spacing and comments to show the logical
> > grouping seems less likely to cause other problems.

Shouldn't the tree structure, if practical, represent the logical
structure?  The actual operations (as the user intends them) are on
particular properties or subnodes, not on top-level trees.

Likewise with the extension of nodes being unordered in the output
tree (or allowing forward references) to disallowing any
situation where ordering of dts statements matters.  It seems to be
sticking with a certain design idea just for the sake of it (or
possibly for the convenience of the existing dtc implementation?), at
the cost of readability/intuitiveness.

It's not an unbearable cost, but I wonder what we really gain from it.

> Though I'm not happy with it, I can live with only allowing removal of
> nodes at the top level.  In fact, that constraint also completely
> removes the need for a /replace-node/ keyword since the remove
> operation is performed at the top level where ordering is explicitly
> allowed.  So, instead of:
> 
> 	/{
> 		node { oldprop; };
> 	};
> 	/{
> 		/replace-node/ the-node { newprop; };
> 	};
> 
> do this instead:
> 
> 	/{
> 		node { oldprop; };
> 	};
> 	/remove-node/ &{/the-node};
> 	/{
> 		the-node { newprop; };
> 	};
> 
> It means only the /remove-node/ keyword needs to be defined.

What about property removal?  Or do you mean the only one related to
nodes?

-Scott



More information about the devicetree-discuss mailing list