diff mbox series

[v2,net-next,6/6] dt-bindings: net: mscc,vsc7514-switch: utilize generic ethernet-switch.yaml

Message ID 20221104045204.746124-7-colin.foster@in-advantage.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series dt-binding preparation for ocelot switches | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 14 of 14 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
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: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 60 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Colin Foster Nov. 4, 2022, 4:52 a.m. UTC
Several bindings for ethernet switches are available for non-dsa switches
by way of ethernet-switch.yaml. Remove these duplicate entries and utilize
the common bindings for the VSC7514.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
Suggested-by: Vladimir Oltean <olteanv@gmail.com>
---

v1 -> v2:
  * Fix "$ref: ethernet-switch.yaml" placement. Oops.
  * Add "unevaluatedProperties: true" to ethernet-ports layer so it
    can correctly read into ethernet-switch.yaml
  * Add "unevaluatedProperties: true" to ethernet-port layer so it can
    correctly read into ethernet-controller.yaml

---
 .../bindings/net/mscc,vsc7514-switch.yaml     | 40 ++-----------------
 1 file changed, 4 insertions(+), 36 deletions(-)

Comments

Rob Herring Nov. 4, 2022, 6:28 p.m. UTC | #1
On Thu, Nov 03, 2022 at 09:52:04PM -0700, Colin Foster wrote:
> Several bindings for ethernet switches are available for non-dsa switches
> by way of ethernet-switch.yaml. Remove these duplicate entries and utilize
> the common bindings for the VSC7514.
> 
> Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
> Suggested-by: Vladimir Oltean <olteanv@gmail.com>
> ---
> 
> v1 -> v2:
>   * Fix "$ref: ethernet-switch.yaml" placement. Oops.
>   * Add "unevaluatedProperties: true" to ethernet-ports layer so it
>     can correctly read into ethernet-switch.yaml
>   * Add "unevaluatedProperties: true" to ethernet-port layer so it can
>     correctly read into ethernet-controller.yaml
> 
> ---
>  .../bindings/net/mscc,vsc7514-switch.yaml     | 40 ++-----------------
>  1 file changed, 4 insertions(+), 36 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml b/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml
> index ee0a504bdb24..3f3f9fd548cf 100644
> --- a/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml
> +++ b/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml
> @@ -18,10 +18,9 @@ description: |
>    packets using CPU. Additionally, PTP is supported as well as FDMA for faster
>    packet extraction/injection.
>  
> -properties:
> -  $nodename:
> -    pattern: "^switch@[0-9a-f]+$"
> +$ref: ethernet-switch.yaml#
>  
> +properties:
>    compatible:
>      const: mscc,vsc7514-switch
>  
> @@ -88,46 +87,15 @@ properties:
>        - const: fdma
>  
>    ethernet-ports:
> -    type: object
> -
> -    properties:
> -      '#address-cells':
> -        const: 1
> -      '#size-cells':
> -        const: 0
>  
> -    additionalProperties: false
> +    unevaluatedProperties: true

Both this and ethernet-switch.yaml allow unevaluated properties. 
Therefore any extra properties will be allowed. Add some to your example 
and see.

>  
>      patternProperties:
>        "^port@[0-9a-f]+$":
> -        type: object
> -        description: Ethernet ports handled by the switch
>  
>          $ref: ethernet-controller.yaml#
>  
> -        unevaluatedProperties: false
> -
> -        properties:
> -          reg:
> -            description: Switch port number
> -
> -          phy-handle: true
> -
> -          phy-mode: true
> -
> -          fixed-link: true
> -
> -          mac-address: true
> -
> -        required:
> -          - reg
> -          - phy-mode
> -
> -        oneOf:
> -          - required:
> -              - phy-handle
> -          - required:
> -              - fixed-link
> +        unevaluatedProperties: true

Same problem here. I'll comment more about this on 
ethernet-switch-port.yaml.

Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml b/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml
index ee0a504bdb24..3f3f9fd548cf 100644
--- a/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml
+++ b/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml
@@ -18,10 +18,9 @@  description: |
   packets using CPU. Additionally, PTP is supported as well as FDMA for faster
   packet extraction/injection.
 
-properties:
-  $nodename:
-    pattern: "^switch@[0-9a-f]+$"
+$ref: ethernet-switch.yaml#
 
+properties:
   compatible:
     const: mscc,vsc7514-switch
 
@@ -88,46 +87,15 @@  properties:
       - const: fdma
 
   ethernet-ports:
-    type: object
-
-    properties:
-      '#address-cells':
-        const: 1
-      '#size-cells':
-        const: 0
 
-    additionalProperties: false
+    unevaluatedProperties: true
 
     patternProperties:
       "^port@[0-9a-f]+$":
-        type: object
-        description: Ethernet ports handled by the switch
 
         $ref: ethernet-controller.yaml#
 
-        unevaluatedProperties: false
-
-        properties:
-          reg:
-            description: Switch port number
-
-          phy-handle: true
-
-          phy-mode: true
-
-          fixed-link: true
-
-          mac-address: true
-
-        required:
-          - reg
-          - phy-mode
-
-        oneOf:
-          - required:
-              - phy-handle
-          - required:
-              - fixed-link
+        unevaluatedProperties: true
 
 required:
   - compatible