diff mbox series

[net-next,4/8] dt-bindings: net: ethernet-switch: Add missing 'ethernet-ports' level

Message ID 20231016-dt-net-cleanups-v1-4-a525a090b444@kernel.org (mailing list archive)
State Accepted
Commit f0fdec925fe7adf725de238b9eea59702d0d58e0
Delegated to: Netdev Maintainers
Headers show
Series dt-bindings: net: Child node schema cleanups | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 9 this patch: 9
netdev/cc_maintainers warning 1 maintainers not CCed: robh+dt@kernel.org
netdev/build_clang success Errors and warnings before: 9 this patch: 9
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 9 this patch: 9
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Rob Herring (Arm) Oct. 16, 2023, 9:44 p.m. UTC
The '$defs/ethernet-ports' schema is referenced by schemas defining a
child node 'ethernet-ports', but this schema misses the
'ethernet-ports' node. It would work if referring schemas made a
reference like this:

properties:
  ethernet-ports:
    $ref: ethernet-switch.yaml#/$defs/ethernet-ports

However, that would be different from how dsa.yaml works. For
consistency, align the schema definition with dsa.yaml and add the
missing level.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 Documentation/devicetree/bindings/net/ethernet-switch.yaml | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Arınç ÜNAL Oct. 17, 2023, 6:32 a.m. UTC | #1
On 17.10.2023 00:44, Rob Herring wrote:
> The '$defs/ethernet-ports' schema is referenced by schemas defining a
> child node 'ethernet-ports', but this schema misses the
> 'ethernet-ports' node. It would work if referring schemas made a
> reference like this:
> 
> properties:
>    ethernet-ports:
>      $ref: ethernet-switch.yaml#/$defs/ethernet-ports
> 
> However, that would be different from how dsa.yaml works. For
> consistency, align the schema definition with dsa.yaml and add the
> missing level.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Arınç ÜNAL <arinc.unal@arinc9.com>

Arınç
Vladimir Oltean Oct. 19, 2023, 1:34 p.m. UTC | #2
On Mon, Oct 16, 2023 at 04:44:23PM -0500, Rob Herring wrote:
> The '$defs/ethernet-ports' schema is referenced by schemas defining a
> child node 'ethernet-ports', but this schema misses the
> 'ethernet-ports' node. It would work if referring schemas made a
> reference like this:
> 
> properties:
>   ethernet-ports:
>     $ref: ethernet-switch.yaml#/$defs/ethernet-ports
> 
> However, that would be different from how dsa.yaml works. For
> consistency, align the schema definition with dsa.yaml and add the
> missing level.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  Documentation/devicetree/bindings/net/ethernet-switch.yaml | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/ethernet-switch.yaml b/Documentation/devicetree/bindings/net/ethernet-switch.yaml
> index dcbffe19d71a..688938c2e261 100644
> --- a/Documentation/devicetree/bindings/net/ethernet-switch.yaml
> +++ b/Documentation/devicetree/bindings/net/ethernet-switch.yaml
> @@ -58,9 +58,11 @@ $defs:
>      $ref: '#'
>  
>      patternProperties:
> -      "^(ethernet-)?port@[0-9a-f]+$":
> -        description: Ethernet switch ports
> -        $ref: ethernet-switch-port.yaml#
> -        unevaluatedProperties: false
> +      "^(ethernet-)?ports$":
> +        patternProperties:
> +          "^(ethernet-)?port@[0-9a-f]+$":
> +            description: Ethernet switch ports
> +            $ref: ethernet-switch-port.yaml#
> +            unevaluatedProperties: false
>  
>  ...
> 
> -- 
> 2.42.0
>

Huh, interesting.

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/ethernet-switch.yaml b/Documentation/devicetree/bindings/net/ethernet-switch.yaml
index dcbffe19d71a..688938c2e261 100644
--- a/Documentation/devicetree/bindings/net/ethernet-switch.yaml
+++ b/Documentation/devicetree/bindings/net/ethernet-switch.yaml
@@ -58,9 +58,11 @@  $defs:
     $ref: '#'
 
     patternProperties:
-      "^(ethernet-)?port@[0-9a-f]+$":
-        description: Ethernet switch ports
-        $ref: ethernet-switch-port.yaml#
-        unevaluatedProperties: false
+      "^(ethernet-)?ports$":
+        patternProperties:
+          "^(ethernet-)?port@[0-9a-f]+$":
+            description: Ethernet switch ports
+            $ref: ethernet-switch-port.yaml#
+            unevaluatedProperties: false
 
 ...