1

dt-bindings: Add missing (unevaluated|additional)Properties on child node schemas

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>
This commit is contained in:
Rob Herring 2023-01-24 17:02:28 -06:00
parent 5eac0bdc78
commit e62fc18213
39 changed files with 63 additions and 8 deletions

View 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:

View 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

View 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.

View 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

View File

@ -45,6 +45,7 @@ properties:
patternProperties:
"^.*@[0-9a-fA-F]+$":
type: object
additionalProperties: true
properties:
reg:
maxItems: 1

View 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

View 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:

View 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

View File

@ -35,6 +35,7 @@ properties:
patternProperties:
"^.*-pins?$":
$ref: /schemas/pinctrl/pinmux-node.yaml#
additionalProperties: false
properties:
pins:

View File

@ -32,6 +32,7 @@ properties:
patternProperties:
"^channel@([0-1])$":
type: object
additionalProperties: false
description: |
Represents the two supplies to be monitored.

View 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.

View 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

View 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:

View 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

View 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

View 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

View File

@ -57,6 +57,7 @@ patternProperties:
subnodes.
type: object
$ref: /schemas/memory-controllers/intel,ixp4xx-expansion-peripheral-props.yaml#
additionalProperties: true
required:
- compatible

View 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

View File

@ -47,6 +47,7 @@ properties:
patternProperties:
"^.*@[0-4],[a-f0-9]+$":
additionalProperties: true
type: object
$ref: mc-peripheral-props.yaml#

View File

@ -46,6 +46,7 @@ properties:
rtc:
type: object
$ref: /schemas/rtc/rtc.yaml#
unevaluatedProperties: false
description:
MT6357 Real Time Clock.
properties:

View 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

View File

@ -42,6 +42,7 @@ patternProperties:
"^sdhci@[0-9a-f]+$":
type: object
$ref: mmc-controller.yaml
unevaluatedProperties: false
properties:
compatible:

View 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

View File

@ -28,6 +28,7 @@ properties:
patternProperties:
'^(ac|usb)$':
type: object
additionalProperties: false
description: USB/AC charging parameters
properties:
charger-type:

View 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:

View File

@ -38,8 +38,9 @@ properties:
patternProperties:
"power-domain@[0-9a-f]+$":
type: object
additionalProperties: false
properties:
compatible:
items:

View 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:

View File

@ -130,6 +130,7 @@ patternProperties:
PRU-ICSS configuration space. CFG sub-module represented as a SysCon.
type: object
additionalProperties: false
properties:
compatible:

View File

@ -60,6 +60,7 @@ properties:
properties:
endpoint:
type: object
additionalProperties: true
properties:
dai-format:

View 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

View 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

View 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.

View File

@ -51,6 +51,7 @@ properties:
patternProperties:
"^.*@[0-9a-f]+":
type: object
additionalProperties: true
properties:
reg:
items:

View File

@ -63,6 +63,7 @@ properties:
patternProperties:
"^.*@[0-9a-f]+":
type: object
additionalProperties: true
properties:
reg:
items:

View File

@ -94,6 +94,7 @@ patternProperties:
"^.*@[0-9a-f]+$":
type: object
$ref: spi-peripheral-props.yaml
additionalProperties: true
properties:
spi-3wire:

View 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

View File

@ -61,6 +61,7 @@ additionalProperties: false
patternProperties:
"-sram@[0-9a-f]+$":
type: object
additionalProperties: false
description: A region of reserved memory.
properties:

View 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

View File

@ -121,6 +121,7 @@ properties:
patternProperties:
"^usb@[0-9a-f]+$":
$ref: snps,dwc3.yaml#
unevaluatedProperties: false
properties:
wakeup-source: false