Open mbolivar-nordic opened 1 year ago
I welcome this policy, however we need to consider existing "upstream" (Linux kernel) bindings using _
separators for properties as a valid exemption for this.
we need to consider existing "upstream" (Linux kernel) bindings using
_
separators for properties as a valid exemption for this.
Indeed, this would make for a good exception -- could you give me some pointers? I did a search in our existing bindings for anything using underscores that had a corresponding binding doing the same in Linux, and I could not find any.
@henrikbrixandersen I added some language about this potential exception. I think the CI results should still be a failure which require admin override, the same way we handle additions of new typedefs.
Indeed, this would make for a good exception -- could you give me some pointers? I did a search in our existing bindings for anything using underscores that had a corresponding binding doing the same in Linux, and I could not find any.
I am not aware of any current "violations" - I just want to make sure that we do not create a policy like this without an exception for upstream/well-established bindings.
@henrikbrixandersen I added some language about this potential exception. I think the CI results should still be a failure which require admin override, the same way we handle additions of new typedefs.
Looks good, thank you.
Makes sense to me
Architecture WG:
_
to -
, otherwise he's in favor. The script might not be trivial and is unclear whether it is worthwhile. @mbolivar-nordic to investigate further No objections to the treewide change
can this be closed? AFAIK it was done already.
can this be closed? AFAIK it was done already.
https://github.com/zephyrproject-rtos/zephyr/pull/53502 is still open
Introduction
Devicetree properties, by convention, use dash (
-
) as a word separator. This RFC proposes making this a requirement for upstream bindings.Problem description
There are currently no automated checks in CI that ensure that devicetree properties use dashes as separators. As a result, many properties use underscore (
_
) as a separator. This is inconsistent with the style adopted by the devicetree specification for all standard properties (with the exception ofdevice_type
, but this property is deprecated and has limited usage).It would be better style to use dashes instead, and would make things consistent for users typing properties. It also would avoid situations like having a
foo-bar
andfoo_bar
property defined on the same node due to typos.Proposed change
Detailed RFC
This is a straightforward treewide change.
Proposed change (Detailed)
Dependencies
Out of tree users of existing bindings will need to migrate to the new property names.
Concerns and Unresolved Questions
None.
Alternatives
An approach which allowed both styles for backwards incompatibility was considered, but this is too ripe for introducing simultaneous use of
foo-bar
vsfoo_bar
in a single devicetree.