Skip to content

Conversation

@dottspina
Copy link
Contributor

PropertySpec.path does not tell "the file where the property was last modified", but instead the binding file specifying the devicetree node of which this is a property.

This is a known issue (#65135), which we thought was fixed (#65221). The solution turned out to be incorrect, and we reverted the patch (#80030).

This PR aims to definitively close #65135 by simply amending the API documentation: edtlib: amend PropertySpec.path API documentation.

While writing this PR, I came across another wording that I found confusing (class edtlib.Node):

    props:
      A dict that maps property names to Property objects.
      Property objects are created for all devicetree properties on the node
      that are mentioned in 'properties:' in the binding.

AFAICT, assuming that "mentioned in 'properties:' in the binding" refers to properties whose specification we find in Node._binding.prop2specs, node properties are created only for those that actually have a value (a default value from the binding, or an explicit value from the DTS).
And usually a node has fewer properties than its binding defines (supports), literally len(node._binding.prop2specs) > len(node.props).
If the above reasoning is correct, then the API documentation seems confusing to me: the additional commit, edtlib: amend Node.props API documentation, is about that.

Thanks

Fixes #65135.

PropertySpec.path does NOT tell "the file where the property
was last modified", but instead the binding file specifying
the devicetree node of which this is a property.

See: zephyrproject-rtos#65135

Signed-off-by: Christophe Dufaza <[email protected]>
Node properties are not created for all properties defined
by the node's binding (Binding.prop2specs),
only for those that actually have a value.

Signed-off-by: Christophe Dufaza <[email protected]>
@kartben kartben merged commit ad22d34 into zephyrproject-rtos:main Jan 30, 2025
44 checks passed
@dottspina dottspina deleted the pr-upd-edtlib-apidoc branch March 12, 2025 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

edtlib: PropertySpec.path API might be incorrect or misleading

4 participants