Commit 659fd097 authored by Rob Herring's avatar Rob Herring Committed by Jakub Kicinski

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: default avatarRob Herring <robh@kernel.org>
Acked-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
Acked-by: default avatarJernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: default avatarGerhard Engleder <gerhard@engleder-embedded.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231016-dt-net-cleanups-v1-1-a525a090b444@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent dcf02bac
...@@ -158,6 +158,8 @@ allOf: ...@@ -158,6 +158,8 @@ allOf:
patternProperties: patternProperties:
"^ethernet-phy@[0-9a-f]$": "^ethernet-phy@[0-9a-f]$":
type: object type: object
$ref: ethernet-phy.yaml#
unevaluatedProperties: false
description: description:
Integrated PHY node Integrated PHY node
......
...@@ -78,6 +78,7 @@ properties: ...@@ -78,6 +78,7 @@ properties:
ports: ports:
type: object type: object
additionalProperties: true
patternProperties: patternProperties:
'^port@[0-9a-f]$': '^port@[0-9a-f]$':
......
...@@ -154,10 +154,12 @@ properties: ...@@ -154,10 +154,12 @@ properties:
patternProperties: patternProperties:
"^(ethernet-)?ports$": "^(ethernet-)?ports$":
type: object type: object
additionalProperties: true
patternProperties: patternProperties:
"^(ethernet-)?port@[0-9]+$": "^(ethernet-)?port@[0-9]+$":
type: object type: object
additionalProperties: true
properties: properties:
reg: reg:
......
...@@ -37,6 +37,7 @@ properties: ...@@ -37,6 +37,7 @@ properties:
patternProperties: patternProperties:
"^(ethernet-)?ports$": "^(ethernet-)?ports$":
additionalProperties: true
patternProperties: patternProperties:
"^(ethernet-)?port@[0-9]+$": "^(ethernet-)?port@[0-9]+$":
allOf: allOf:
......
...@@ -43,6 +43,7 @@ properties: ...@@ -43,6 +43,7 @@ properties:
# PHY 1. # PHY 1.
mdios: mdios:
type: object type: object
additionalProperties: false
properties: properties:
'#address-cells': '#address-cells':
...@@ -74,6 +75,7 @@ properties: ...@@ -74,6 +75,7 @@ properties:
patternProperties: patternProperties:
"^(ethernet-)?ports$": "^(ethernet-)?ports$":
additionalProperties: true
patternProperties: patternProperties:
"^(ethernet-)?port@[0-9]+$": "^(ethernet-)?port@[0-9]+$":
allOf: allOf:
......
...@@ -73,6 +73,7 @@ $ref: dsa.yaml# ...@@ -73,6 +73,7 @@ $ref: dsa.yaml#
patternProperties: patternProperties:
"^(ethernet-)?ports$": "^(ethernet-)?ports$":
type: object type: object
additionalProperties: true
patternProperties: patternProperties:
"^(ethernet-)?port@[0-6]$": "^(ethernet-)?port@[0-6]$":
type: object type: object
......
...@@ -68,6 +68,8 @@ properties: ...@@ -68,6 +68,8 @@ properties:
interrupt-controller: interrupt-controller:
type: object type: object
additionalProperties: false
description: | description: |
This defines an interrupt controller with an IRQ line (typically This defines an interrupt controller with an IRQ line (typically
a GPIO) that will demultiplex and handle the interrupt from the single a GPIO) that will demultiplex and handle the interrupt from the single
......
...@@ -61,17 +61,11 @@ properties: ...@@ -61,17 +61,11 @@ properties:
ethernet-ports: ethernet-ports:
type: object type: object
properties: additionalProperties: true
'#address-cells':
const: 1
'#size-cells':
const: 0
patternProperties: patternProperties:
"^(ethernet-)?port@[0-4]$": "^(ethernet-)?port@[0-4]$":
type: object type: object
description: Ethernet switch ports additionalProperties: true
properties: properties:
pcs-handle: pcs-handle:
maxItems: 1 maxItems: 1
......
...@@ -63,6 +63,7 @@ properties: ...@@ -63,6 +63,7 @@ properties:
mdio: mdio:
type: object type: object
$ref: mdio.yaml# $ref: mdio.yaml#
unevaluatedProperties: false
description: optional node for embedded MDIO controller description: optional node for embedded MDIO controller
required: required:
......
...@@ -20,6 +20,7 @@ allOf: ...@@ -20,6 +20,7 @@ allOf:
patternProperties: patternProperties:
"^ethernet-phy@[0-9a-f]+$": "^ethernet-phy@[0-9a-f]+$":
type: object type: object
additionalProperties: false
description: | description: |
Some packages have multiple PHYs. Secondary PHY should be defines as Some packages have multiple PHYs. Secondary PHY should be defines as
subnode of the first (parent) PHY. subnode of the first (parent) PHY.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment