Skip to content

Commit 27ff632

Browse files
selvarasu-grgushchin
authored andcommitted
projects: linux: add DT binding ordering, items, and subject rules
A review of a new dt-bindings patch showed that the dt-bindings maintainer raised, and Sashiko missed, the following three conventions: - the canonical property order (interrupts after clocks, power-domains after interrupts) - per-entry items descriptions instead of free-form clock descriptions repeating min/maxItems - the redundant "binding" word in dt-bindings: subjects Record all three in the dt-bindings maintainer note so reviews of future binding patches apply them, covering both the schema (the properties: and required: lists) and the DTS node under examples:. The subject rule is worded as an explicit reviewer check rather than a convention: in E2E runs of the same patch, the convention-style wording was never acted on (two runs in a row did not flag the subject), while the check wording reported the finding (Low) alongside the schema findings. Signed-off-by: Selvarasu Ganesan <selvarasu.g@samsung.com>
1 parent ba80c87 commit 27ff632

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎projects/linux/prompts/maintainers/dt-bindings.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ Conventions for structuring Device Tree binding YAML schemas under Documentation
1010
- For new bindings or major schema restructurings, if per-compatible `if`/`then` conditionals in a single binding schema become unwieldy because of variant differences, prefer splitting the binding into separate schema documents rather than piling on more conditionals. Do not ask bug-fix commits (`Fixes:`) or small single-property or single-compatible additions to split an existing multi-SoC binding YAML file.
1111
- Do not invent `dtschema` restrictions that `dt_binding_check` does not enforce: there is no `-bytes` standard unit suffix in `property-units.yaml`; single-item `enum:` lists (for example under `contains:`) and `description:` keys inside `if:`/`then:` blocks are valid `dtschema`; and `examples:` only need to illustrate one valid node rather than enumerating every possible IRQ flag or variant.
1212
- When converting legacy free-form `.txt` bindings to DT schema YAML, matching actual in-tree `.dts`/`.dtsi` users rather than copying unused or imprecise compatibles from the old `.txt` file is expected.
13+
- Check the order of properties in both the schema (the properties: and required: lists) and the DTS node under examples:; all must use the canonical sequence used across the tree — compatible, reg, clocks, clock-names, interrupts, interrupt-names, power-domains, power-domain-names (listing only the properties present); interrupts go after clocks and power-domains go after interrupts, so flag a schema or example node that lists interrupts before clocks.
14+
- When a property has a fixed set of entries (such as a two-entry clocks), name each entry with an items list carrying a per-entry description instead of a free-form description enumerating them, and do not restate schema constraints such as counts or minItems/maxItems in description text.
15+
- Check the patch subject for the redundant word "binding": the dt-bindings: prefix already states the patch adds a binding, so flag subjects that repeat it, e.g. "dt-bindings: usb: Add Vendor SoC DWC3 controller binding" should be "dt-bindings: usb: Add Vendor SoC DWC3 controller".

0 commit comments

Comments
 (0)