[PATCH v2] dt-bindings: example-schema: Show example of dependentRequired
From: Krzysztof Kozlowski
Date: Wed Nov 11 2026 - 06:14:39 EST
dependentRequired is shorter and preferred form of conditional property
requirement, over allOf:if:then: block, so document example usage.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxxxxx>
---
Changes in v2:
1. Use clocks/clock-names in the dependentRequired, to avoid conflict
with existing foo-supply constraint.
---
Documentation/devicetree/bindings/example-schema.yaml | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/Documentation/devicetree/bindings/example-schema.yaml b/Documentation/devicetree/bindings/example-schema.yaml
index b04f3cc4312c..a37d10ff7469 100644
--- a/Documentation/devicetree/bindings/example-schema.yaml
+++ b/Documentation/devicetree/bindings/example-schema.yaml
@@ -217,6 +217,14 @@ required:
- interrupts
- interrupt-controller
+# Properties might be required only if some other property is present.
+# dependentRequired is a shorter and preferred way to express this, instead of
+# if:then: block.
+dependentRequired:
+ # clocks is not a required property in this binding, but if present, then
+ # clock-names must be provided as well.
+ clocks: [ clock-names ]
+
# if/then schema can be used to handle conditions on a property affecting
# another property. A typical case is a specific 'compatible' value changes the
# constraints on other properties.
--
2.53.0