dt-bindings: Add missing (unevaluated|additional)Properties on child node schemas
authorRob Herring <robh@kernel.org>
Tue, 24 Jan 2023 23:02:28 +0000 (17:02 -0600)
committerRob Herring <robh@kernel.org>
Wed, 5 Apr 2023 20:38:38 +0000 (15:38 -0500)
Just as unevaluatedProperties or additionalProperties are required at
the top level of schemas, they should (and will) also be required for
child node schemas. That ensures only documented properties are
present.

Add unevaluatedProperties or additionalProperties as appropriate, and
then add any missing properties flagged by the addition.

Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Lee Jones <lee@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230124230228.372305-1-robh@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
39 files changed:
Documentation/devicetree/bindings/arm/arm,vexpress-juno.yaml
Documentation/devicetree/bindings/arm/bcm/raspberrypi,bcm2835-firmware.yaml
Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.yaml
Documentation/devicetree/bindings/bus/allwinner,sun50i-a64-de2.yaml
Documentation/devicetree/bindings/bus/allwinner,sun8i-a23-rsb.yaml
Documentation/devicetree/bindings/bus/palmbus.yaml
Documentation/devicetree/bindings/display/msm/qcom,mdss.yaml
Documentation/devicetree/bindings/example-schema.yaml
Documentation/devicetree/bindings/gpio/x-powers,axp209-gpio.yaml
Documentation/devicetree/bindings/hwmon/adi,ltc2992.yaml
Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml
Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml
Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.yaml
Documentation/devicetree/bindings/media/i2c/maxim,max9286.yaml
Documentation/devicetree/bindings/memory-controllers/arm,pl35x-smc.yaml
Documentation/devicetree/bindings/memory-controllers/exynos-srom.yaml
Documentation/devicetree/bindings/memory-controllers/intel,ixp4xx-expansion-bus-controller.yaml
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra124-emc.yaml
Documentation/devicetree/bindings/memory-controllers/st,stm32-fmc2-ebi.yaml
Documentation/devicetree/bindings/mfd/mediatek,mt6357.yaml
Documentation/devicetree/bindings/mfd/mediatek,mt6370.yaml
Documentation/devicetree/bindings/mmc/aspeed,sdhci.yaml
Documentation/devicetree/bindings/mtd/mtd.yaml
Documentation/devicetree/bindings/power/supply/ti,lp8727.yaml
Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml
Documentation/devicetree/bindings/soc/imx/fsl,imx93-src.yaml
Documentation/devicetree/bindings/soc/microchip/atmel,at91rm9200-tcb.yaml
Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
Documentation/devicetree/bindings/sound/marvell,mmp-sspa.yaml
Documentation/devicetree/bindings/sound/qcom,wcd934x.yaml
Documentation/devicetree/bindings/sound/samsung,odroid.yaml
Documentation/devicetree/bindings/soundwire/qcom,soundwire.yaml
Documentation/devicetree/bindings/spi/allwinner,sun4i-a10-spi.yaml
Documentation/devicetree/bindings/spi/allwinner,sun6i-a31-spi.yaml
Documentation/devicetree/bindings/spi/spi-controller.yaml
Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
Documentation/devicetree/bindings/sram/qcom,ocmem.yaml
Documentation/devicetree/bindings/thermal/thermal-zones.yaml
Documentation/devicetree/bindings/usb/qcom,dwc3.yaml

index eec190a96225741e9f33be0379c3a1446b294b97..09c319f803ba43817bf8fc6e0ab9a195dff4ea29 100644 (file)
@@ -144,6 +144,7 @@ patternProperties:
       it is stricter and always has two compatibles.
     type: object
     $ref: '/schemas/simple-bus.yaml'
+    unevaluatedProperties: false
 
     properties:
       compatible:
index b369b374fc4a547737a190fbda3327ada8959423..39e3c248f5b7dd7769717ae2ce8c5684042a3363 100644 (file)
@@ -30,6 +30,7 @@ properties:
 
   clocks:
     type: object
+    additionalProperties: false
 
     properties:
       compatible:
@@ -47,6 +48,7 @@ properties:
 
   reset:
     type: object
+    additionalProperties: false
 
     properties:
       compatible:
@@ -63,6 +65,7 @@ properties:
 
   pwm:
     type: object
+    additionalProperties: false
 
     properties:
       compatible:
@@ -76,8 +79,6 @@ properties:
       - compatible
       - "#pwm-cells"
 
-    additionalProperties: false
-
 required:
   - compatible
   - mboxes
index 4a00593b9f7f1611dacf32dec54a00504c8b25d4..89191cfdf6197461286a7fc22c9f774d8eef4321 100644 (file)
@@ -234,6 +234,7 @@ properties:
     patternProperties:
       "^[a-z0-9]+$":
         type: object
+        additionalProperties: false
 
         properties:
           clocks:
@@ -252,6 +253,9 @@ properties:
               for controlling a power-gate.
               See ../reset/reset.txt for more details.
 
+          power-domains:
+            maxItems: 1
+
           '#power-domain-cells':
             const: 0
             description: Must be 0.
index 85c4a979aec4631b2a61c8118a18685c393fba8a..9845a187bdf65a92fdd44f87fc8304d58dc86072 100644 (file)
@@ -46,6 +46,7 @@ patternProperties:
   # All other properties should be child nodes with unit-address and 'reg'
   "^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}@[0-9a-fA-F]+$":
     type: object
+    additionalProperties: true
     properties:
       reg:
         maxItems: 1
index bee5f53f837fea5aa1804886d6facce036d1aae5..24c939f59091082853eae9cd9e7584336faf5527 100644 (file)
@@ -45,6 +45,7 @@ properties:
 patternProperties:
   "^.*@[0-9a-fA-F]+$":
     type: object
+    additionalProperties: true
     properties:
       reg:
         maxItems: 1
index 30fa6526cfc22ccfc21438552976f75b3bdead3e..c36c1e92a5737fd87bf1a4da57713a949c12438d 100644 (file)
@@ -36,6 +36,7 @@ patternProperties:
   # All other properties should be child nodes with unit-address and 'reg'
   "@[0-9a-f]+$":
     type: object
+    additionalProperties: true
     properties:
       reg:
         maxItems: 1
index 20889e409430092b54a5a8acb88bf13c87b91fde..b0100105e428e77e11e409ee210a93f376a31786 100644 (file)
@@ -101,6 +101,7 @@ required:
 patternProperties:
   "^display-controller@[1-9a-f][0-9a-f]*$":
     type: object
+    additionalProperties: true
     properties:
       compatible:
         contains:
@@ -108,6 +109,7 @@ patternProperties:
 
   "^dsi@[1-9a-f][0-9a-f]*$":
     type: object
+    additionalProperties: true
     properties:
       compatible:
         contains:
@@ -115,6 +117,7 @@ patternProperties:
 
   "^phy@[1-9a-f][0-9a-f]*$":
     type: object
+    additionalProperties: true
     properties:
       compatible:
         enum:
@@ -132,6 +135,7 @@ patternProperties:
 
   "^hdmi-tx@[1-9a-f][0-9a-f]*$":
     type: object
+    additionalProperties: true
     properties:
       compatible:
         enum:
index dfcf4c27d44a3e997fbecdb97a52289146f1039f..f4eec4c42fb3e432f226da2170a002b4ab6b4d98 100644 (file)
@@ -176,6 +176,8 @@ properties:
     description: Child nodes are just another property from a json-schema
       perspective.
     type: object  # DT nodes are json objects
+    # Child nodes also need additionalProperties or unevaluatedProperties
+    additionalProperties: false
     properties:
       vendor,a-child-node-property:
         description: Child node properties have all the same schema
index 7f26f6b1eea1105127d204f5e01967df661ad1df..31906c25394099469a2456af80e89fef36ba5187 100644 (file)
@@ -35,6 +35,7 @@ properties:
 patternProperties:
   "^.*-pins?$":
     $ref: /schemas/pinctrl/pinmux-node.yaml#
+    additionalProperties: false
 
     properties:
       pins:
index dba74f400bc2914d3c75aaf29fd2feb481d8ab54..b39c632956e80641dd61159bec08c7a96ec28f42 100644 (file)
@@ -32,6 +32,7 @@ properties:
 patternProperties:
   "^channel@([0-1])$":
     type: object
+    additionalProperties: false
     description: |
       Represents the two supplies to be monitored.
 
index d9d243c5514b5ef4444a9f7d9716acfd05a70b9b..4f95d512012af1f2ded915887b8d99e4a61e9c7c 100644 (file)
@@ -66,6 +66,7 @@ properties:
 patternProperties:
   '^interconnect-[a-z0-9]+$':
     type: object
+    additionalProperties: false
     description:
       snoc-mm is a child of snoc, sharing snoc's register address space.
 
index 8449e14af9f3580fae820a1efd31f713d58af297..92117261e1e1d0e985e47fe6fca5814a2e4293db 100644 (file)
@@ -133,12 +133,14 @@ properties:
 
   ppi-partitions:
     type: object
+    additionalProperties: false
     description:
       PPI affinity can be expressed as a single "ppi-partitions" node,
       containing a set of sub-nodes.
     patternProperties:
       "^interrupt-partition-[0-9]+$":
         type: object
+        additionalProperties: false
         properties:
           affinity:
             $ref: /schemas/types.yaml#/definitions/phandle-array
index 45df46343f6a923555c64da475efcd0ddfa292b4..374ffe64016f3f5059320918f5058fb544f832b4 100644 (file)
@@ -72,6 +72,7 @@ patternProperties:
   '^mailbox@[0-9a-f]+$':
     description: Internal ipi mailbox node
     type: object  # DT nodes are json objects
+    additionalProperties: false
     properties:
       xlnx,ipi-id:
         description:
index 0c4213adbf6aaca6824d7ff58d0d0a8dc5386cc0..01b836aca065aeb511ed30ad18c403ef2b78b5db 100644 (file)
@@ -156,6 +156,7 @@ properties:
     patternProperties:
       "^i2c@[0-3]$":
         type: object
+        additionalProperties: false
         description: |
           Child node of the i2c bus multiplexer which represents a GMSL link.
           Each serializer device on the GMSL link remote end is represented with
@@ -167,6 +168,12 @@ properties:
             description: The index of the GMSL channel.
             maxItems: 1
 
+          '#address-cells':
+            const: 1
+
+          '#size-cells':
+            const: 0
+
         patternProperties:
           "^camera@[a-f0-9]+$":
             type: object
index bd23257fe02199b6a244ee0340387b79449d7831..6d3962a17e49462992f6d2d90d65562deeb7c716 100644 (file)
@@ -73,6 +73,7 @@ properties:
 patternProperties:
   "@[0-7],[a-f0-9]+$":
     type: object
+    additionalProperties: true
     description: |
       The child device node represents the controller connected to the SMC
       bus. The controller can be a NAND controller or a pair of any memory
index c6e44f47ce7cfca978fac48f936f33c30913855f..10a2d97e5f8b512315de54698dc58a1df1a457c4 100644 (file)
@@ -38,6 +38,7 @@ properties:
 patternProperties:
   "^.*@[0-3],[a-f0-9]+$":
     type: object
+    additionalProperties: true
     description:
       The actual device nodes should be added as subnodes to the SROMc node.
       These subnodes, in addition to regular device specification, should
index 188db821dff3c4dc778af67cb18a30885a662172..3049d6bb0b1fe631f29734a41be98f914bf263f1 100644 (file)
@@ -57,6 +57,7 @@ patternProperties:
       subnodes.
     type: object
     $ref: /schemas/memory-controllers/intel,ixp4xx-expansion-peripheral-props.yaml#
+    additionalProperties: true
 
 required:
   - compatible
index 9163c3f12a853b147626f42dd514fcbd45e888c7..f5f03bf364137cd50aba871cb1bb4bd4ffc7021d 100644 (file)
@@ -50,6 +50,7 @@ properties:
 patternProperties:
   "^emc-timings-[0-9]+$":
     type: object
+    additionalProperties: false
     properties:
       nvidia,ram-code:
         $ref: /schemas/types.yaml#/definitions/uint32
index e76ba767dfd2200accb6a43e5c7529d7aafc9ccc..14f1833d37c9b8cb10226e204488914acfd07769 100644 (file)
@@ -47,6 +47,7 @@ properties:
 
 patternProperties:
   "^.*@[0-4],[a-f0-9]+$":
+    additionalProperties: true
     type: object
     $ref: mc-peripheral-props.yaml#
 
index 837a77013d57b8da5493f77e20b453c6ad0cdc0b..fc2a53148e1cbbb824e9bd9a67237e6e3e91dcb4 100644 (file)
@@ -46,6 +46,7 @@ properties:
   rtc:
     type: object
     $ref: /schemas/rtc/rtc.yaml#
+    unevaluatedProperties: false
     description:
       MT6357 Real Time Clock.
     properties:
index 5644882db2e8a84761b886c4c9fae777447d1213..c9574b2430468d5b31b87c5af4af32b6d70eec0b 100644 (file)
@@ -35,6 +35,7 @@ properties:
 
   adc:
     type: object
+    additionalProperties: false
     description: |
       Provides 9 channels for system monitoring, including VBUSDIV5 (lower
       accuracy, higher measure range), VBUSDIV2 (higher accuracy, lower
@@ -73,6 +74,7 @@ properties:
 
   regulators:
     type: object
+    additionalProperties: false
     description: |
       List all supported regulators, which support the control for DisplayBias
       voltages and one general purpose LDO which commonly used to drive the
index 987b287f3bff66feda3ef365c69fc02626caed98..9fce8cd7b0b62bdbd391f3bd6d1dad655a6f7ccc 100644 (file)
@@ -42,6 +42,7 @@ patternProperties:
   "^sdhci@[0-9a-f]+$":
     type: object
     $ref: mmc-controller.yaml
+    unevaluatedProperties: false
 
     properties:
       compatible:
index 78da129e99852ee383e8ab3982eeb5f91df0d92c..da3d488c335f75c272d74c6400d31f0bb7b37fc9 100644 (file)
@@ -44,6 +44,7 @@ patternProperties:
 
   "^otp(-[0-9]+)?$":
     $ref: ../nvmem/nvmem.yaml#
+    unevaluatedProperties: false
 
     description: |
       An OTP memory region. Some flashes provide a one-time-programmable
index 3a9e4310b433cd6ee6b3b46d61bb2b04bdb55ea0..069422a8c90ceca2a71330b7cf492205bf3f2e22 100644 (file)
@@ -28,6 +28,7 @@ properties:
 patternProperties:
   '^(ac|usb)$':
     type: object
+    additionalProperties: false
     description: USB/AC charging parameters
     properties:
       charger-type:
index 6e6e69ad9cd73525722e433d340bfe8cc804b024..588b010b2a9e53946a615219fc1468bc700deef8 100644 (file)
@@ -157,6 +157,7 @@ properties:
 
   mba:
     type: object
+    additionalProperties: false
     description:
       MBA reserved region (prefer using memory-region with two items)
     properties:
@@ -167,6 +168,7 @@ properties:
 
   mpss:
     type: object
+    additionalProperties: false
     description:
       MPSS reserved region (prefer using memory-region with two items)
     properties:
index c1cc69b5198101c1acb0a4ce5f20c066b3c44f7a..9ce8d8b427fa626ba69e22f71c0bbcdf92089626 100644 (file)
@@ -38,8 +38,9 @@ properties:
 
 patternProperties:
   "power-domain@[0-9a-f]+$":
-
     type: object
+    additionalProperties: false
+
     properties:
       compatible:
         items:
index 33748a06189830898b8caf702962c352b40f1e6b..a46411149571f19411cb29cae4f87f37ab69feda 100644 (file)
@@ -54,6 +54,7 @@ patternProperties:
   "^timer@[0-2]$":
     description: The timer block channels that are used as timers or counters.
     type: object
+    additionalProperties: false
     properties:
       compatible:
         items:
index c697691f1fd4100245dd348dc815f8a06de05122..c402cb2928e893ced1d9d9b0ed7731c23d212571 100644 (file)
@@ -130,6 +130,7 @@ patternProperties:
       PRU-ICSS configuration space. CFG sub-module represented as a SysCon.
 
     type: object
+    additionalProperties: false
 
     properties:
       compatible:
index f302fe89a25362eb9faf2a6e3e318666bd1fc04e..4193d17d1c62a78267a16555481956b7c3cc5a97 100644 (file)
@@ -60,6 +60,7 @@ properties:
     properties:
       endpoint:
         type: object
+        additionalProperties: true
 
         properties:
           dai-format:
index ea09590bfa307466d12f4249dacced24dd9d4a52..30506d91fddd67508a3b29091efa881c782c5268 100644 (file)
@@ -134,6 +134,7 @@ properties:
 patternProperties:
   "^.*@[0-9a-f]+$":
     type: object
+    additionalProperties: true
     description: |
       WCD934x subnode for each slave devices. Bindings of each subnodes
       depends on the specific driver providing the functionality and
index 7774543b881974624dee8aac9a8aff182f51608f..c6751c40e63f5c6517b7d87db31d17828fdc6324 100644 (file)
@@ -35,12 +35,14 @@ properties:
 
   cpu:
     type: object
+    additionalProperties: false
     properties:
       sound-dai:
         description: phandles to the I2S controllers
 
   codec:
     type: object
+    additionalProperties: false
     properties:
       sound-dai:
         minItems: 1
index 3efdc192ab019182571338fef555dd3a9653c6f7..e4dba825ab117b8e346ff4c17d70714555f77bf2 100644 (file)
@@ -200,6 +200,7 @@ properties:
 patternProperties:
   "^.*@[0-9a-f],[0-9a-f]$":
     type: object
+    additionalProperties: true
     description:
       Child nodes for a standalone audio codec or speaker amplifier IC.
       It has RX and TX Soundwire secondary devices.
index eb0567b2971a270caec1eb13d19435c7576b37f0..2155478bfc4de1d06ec3225050f01d0756c75a09 100644 (file)
@@ -51,6 +51,7 @@ properties:
 patternProperties:
   "^.*@[0-9a-f]+":
     type: object
+    additionalProperties: true
     properties:
       reg:
         items:
index acf218507d22381ecea5aaa0d9c044a692dce409..de36c6a34a0f6d9561deafc444cef7f6b2458965 100644 (file)
@@ -63,6 +63,7 @@ properties:
 patternProperties:
   "^.*@[0-9a-f]+":
     type: object
+    additionalProperties: true
     properties:
       reg:
         items:
index 5a7c72cadf76bdf22cf7f63996d79fd514fd78e6..90945f59b7e8b584dbc16d6ad5925308fda668cd 100644 (file)
@@ -94,6 +94,7 @@ patternProperties:
   "^.*@[0-9a-f]+$":
     type: object
     $ref: spi-peripheral-props.yaml
+    additionalProperties: true
 
     properties:
       spi-3wire:
index 98a7dc7f467d91fde72eab705ddb7edc2ea8d425..a1c96985951ff2b1083ed64d86bcf24235ad9101 100644 (file)
@@ -57,17 +57,17 @@ properties:
 
 patternProperties:
   "^sram@[a-z0-9]+":
-    type: object
-
-    properties:
-      compatible:
-        const: mmio-sram
+    $ref: /schemas/sram/sram.yaml#
+    unevaluatedProperties: false
 
     patternProperties:
       "^sram-section?@[a-f0-9]+$":
         type: object
+        additionalProperties: false
 
         properties:
+          reg: true
+
           compatible:
             oneOf:
               - const: allwinner,sun4i-a10-sram-a3-a4
index 071f2d6761968d6bdd0a4fcf132b6a1bb7305514..4bbf6db0b6bd6f36c6496a43c2163db14fa54eef 100644 (file)
@@ -61,6 +61,7 @@ additionalProperties: false
 patternProperties:
   "-sram@[0-9a-f]+$":
     type: object
+    additionalProperties: false
     description: A region of reserved memory.
 
     properties:
index 8581821fa4e1774413771178d3cbe2abf9dce950..4f3acdc4dec0eff987cc83a94c301aff7f3a05f5 100644 (file)
@@ -171,6 +171,7 @@ patternProperties:
 
       cooling-maps:
         type: object
+        additionalProperties: false
         description:
           This node describes the action to be taken when a thermal zone
           crosses one of the temperature thresholds described in the trips
index 4875c5b7d5b543bcde0f8d30830c99652abdc720..3e401014e3bc298e9f890bfde98aa9547ddd80a6 100644 (file)
@@ -121,6 +121,7 @@ properties:
 patternProperties:
   "^usb@[0-9a-f]+$":
     $ref: snps,dwc3.yaml#
+    unevaluatedProperties: false
 
     properties:
       wakeup-source: false