dt-bindings: net: dsa: inherit the ethernet-controller DT schema
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 18 Oct 2021 19:29:50 +0000 (22:29 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Oct 2021 10:32:28 +0000 (11:32 +0100)
Since a switch is basically a bunch of Ethernet controllers, just
inherit the common schema for one to get stronger type validation of the
properties of a port.

For example, before this change it was valid to have a phy-mode = "xfi"
even if "xfi" is not part of ethernet-controller.yaml, now it is not.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/devicetree/bindings/net/dsa/dsa.yaml

index 224cfa4..9cfd08c 100644 (file)
@@ -46,6 +46,9 @@ patternProperties:
         type: object
         description: Ethernet switch ports
 
+        allOf:
+          - $ref: "http://devicetree.org/schemas/net/ethernet-controller.yaml#"
+
         properties:
           reg:
             description: Port number