Skip to content

Require recommended word separator (-) in devicetree property names #53506

@mbolivar-nordic

Description

@mbolivar-nordic

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 of device_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 and foo_bar property defined on the same node due to typos.

Proposed change

  1. Make all in-tree bindings and DTS files use dashes
  2. Add CI checks to make sure we don't regress this

Detailed RFC

This is a straightforward treewide change.

Proposed change (Detailed)

  1. Use grep to fix in-tree occurrences
  2. Modify edtlib to expose first-class methods that list all binding objects
  3. Add a new compliance check that uses these methods to complain on regressions, allowing administrator override if cases arise where we are inheriting an underscore in a property name from Linux bindings or other authoritative sources

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 vs foo_bar in a single devicetree.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions