dt-bindings: net: 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 for any node.

Add unevaluatedProperties or additionalProperties as appropriate.

Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231016-dt-net-cleanups-v1-1-a525a090b444@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Rob Herring 2023-10-16 16:44:20 -05:00 committed by Jakub Kicinski
parent dcf02bac37
commit 659fd097b0
10 changed files with 15 additions and 8 deletions

View File

@ -158,6 +158,8 @@ allOf:
patternProperties:
"^ethernet-phy@[0-9a-f]$":
type: object
$ref: ethernet-phy.yaml#
unevaluatedProperties: false
description:
Integrated PHY node

View File

@ -78,6 +78,7 @@ properties:
ports:
type: object
additionalProperties: true
patternProperties:
'^port@[0-9a-f]$':

View File

@ -154,10 +154,12 @@ properties:
patternProperties:
"^(ethernet-)?ports$":
type: object
additionalProperties: true
patternProperties:
"^(ethernet-)?port@[0-9]+$":
type: object
additionalProperties: true
properties:
reg:

View File

@ -37,6 +37,7 @@ properties:
patternProperties:
"^(ethernet-)?ports$":
additionalProperties: true
patternProperties:
"^(ethernet-)?port@[0-9]+$":
allOf:

View File

@ -43,6 +43,7 @@ properties:
# PHY 1.
mdios:
type: object
additionalProperties: false
properties:
'#address-cells':
@ -74,6 +75,7 @@ properties:
patternProperties:
"^(ethernet-)?ports$":
additionalProperties: true
patternProperties:
"^(ethernet-)?port@[0-9]+$":
allOf:

View File

@ -73,6 +73,7 @@ $ref: dsa.yaml#
patternProperties:
"^(ethernet-)?ports$":
type: object
additionalProperties: true
patternProperties:
"^(ethernet-)?port@[0-6]$":
type: object

View File

@ -68,6 +68,8 @@ properties:
interrupt-controller:
type: object
additionalProperties: false
description: |
This defines an interrupt controller with an IRQ line (typically
a GPIO) that will demultiplex and handle the interrupt from the single

View File

@ -61,17 +61,11 @@ properties:
ethernet-ports:
type: object
properties:
'#address-cells':
const: 1
'#size-cells':
const: 0
additionalProperties: true
patternProperties:
"^(ethernet-)?port@[0-4]$":
type: object
description: Ethernet switch ports
additionalProperties: true
properties:
pcs-handle:
maxItems: 1

View File

@ -63,6 +63,7 @@ properties:
mdio:
type: object
$ref: mdio.yaml#
unevaluatedProperties: false
description: optional node for embedded MDIO controller
required:

View File

@ -20,6 +20,7 @@ allOf:
patternProperties:
"^ethernet-phy@[0-9a-f]+$":
type: object
additionalProperties: false
description: |
Some packages have multiple PHYs. Secondary PHY should be defines as
subnode of the first (parent) PHY.