]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
docs: dt: writing-schema: explain additional/unevaluatedProperties
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 12 Feb 2024 15:05:23 +0000 (16:05 +0100)
committerRob Herring <robh@kernel.org>
Tue, 13 Feb 2024 18:12:29 +0000 (12:12 -0600)
Add to the list of schema contents expected keywords with their
explanation: additionalProperties and unevaluatedProperties.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240212150524.81819-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Rob Herring <robh@kernel.org>
Documentation/devicetree/bindings/writing-schema.rst

index 2e5575e6a4e5ba5eac9ea78aa549b315e3204c3b..a35859f3be0095c29b9e671f362a4c88c9c94a48 100644 (file)
@@ -71,6 +71,26 @@ required
   A list of DT properties from the 'properties' section that
   must always be present.
 
+additionalProperties / unevaluatedProperties
+  Keywords controlling how schema will validate properties not matched by this
+  schema's 'properties' or 'patternProperties'. Each schema is supposed to
+  have exactly one of these keywords in top-level part, so either
+  additionalProperties or unevaluatedProperties. Nested nodes, so properties
+  being objects, are supposed to have one as well.
+
+  * additionalProperties: false
+      Most common case, where no additional schema is referenced or if this
+      binding allows subset of properties from other referenced schemas.
+
+  * unevaluatedProperties: false
+      Used when this binding references other schema whose all properties
+      should be allowed.
+
+  * additionalProperties: true
+      Rare case, used for schemas implementing common set of properties. Such
+      schemas are supposed to be referenced by other schemas, which then use
+      'unevaluatedProperties: false'.  Typically bus or common-part schemas.
+
 examples
   Optional. A list of one or more DTS hunks implementing the
   binding. Note: YAML doesn't allow leading tabs, so spaces must be used instead.