[PATCH 8/9 V3] Add documentation for the new DTS language.
Scott Wood
scottwood at freescale.com
Tue Mar 2 06:38:46 EST 2010
Grant Likely wrote:
> Okay. So the redefinition of nodes feature got implemented far faster
> than I expected it would. Woohoo! :-)
>
> That leaves the last bit that I really care about; deleting nodes and
> properties. I can probably find the time to implement the C code for
> this, but have no idea how to do the grammer, and I don't think we've
> got a consensus on syntax.
>
> Given the following tree...
>
> / {
> child-label: child {
> prop = <0xbad>;
> grandchild-label: grandchild {
> };
> };
> };
>
> ...here are the use cases that I see as important (plus some suggested
> syntax. I'm not happy with it though, and I'm open to better ideas).
>
> 1) Deleting a property from a node:
> &child-label {
> /* syntax to delete "prop" property */
> delete-prop("prop");
> ^prop; /* this isn't very good, hard to differentiate from
> node deletion */
> __delete_property = "prop";
> };
>
> 2) Delete a child node:
> &child-label {
> /* syntax to delete "grandchild" node */
> delete-node("grandchild");
> ^grandchild;
> __delete_node = "grandchild";
> grandchild = ^{};
> };
>
> 3) Delete a labelled node from the top level:
> delete-node(&grandchild-label);
I vote for the function-like option -- delete-prop("prop"), etc.
-Scott
More information about the devicetree-discuss
mailing list