The Realtek Otto switch family provides different numbers of MDIO buses. RTL838x has one bus, RTL839x has two buses, and RTL930x/RTL931x have four buses. The binding currently accepts mdio-bus@0 through mdio-bus@3 for every supported compatible, allowing non-existent buses to be described for RTL838x and RTL839x devices. Select the permitted bus node names based on the controller compatible. Signed-off-by: Markus Stockhausen --- .../bindings/net/realtek,rtl9301-mdio.yaml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml b/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml index 67e0b23a8470..7f5b4897487b 100644 --- a/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml +++ b/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml @@ -67,6 +67,30 @@ patternProperties: unevaluatedProperties: false +allOf: + - if: + properties: + compatible: + contains: + enum: + - realtek,rtl8380-mdio + - realtek,rtl8381-mdio + - realtek,rtl8382-mdio + then: + patternProperties: + '^mdio-bus@[1-3]$': false + - if: + properties: + compatible: + contains: + enum: + - realtek,rtl8391-mdio + - realtek,rtl8392-mdio + - realtek,rtl8393-mdio + then: + patternProperties: + '^mdio-bus@[2-3]$': false + required: - compatible - reg -- 2.55.0