From d5b2fb6761aeb78fc3eaba6da873c7eb7055fa86 Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Mon, 5 Oct 2026 09:49:04 +0200 Subject: [PATCH] dt-bindings: net: realtek,rtl9301-mdio: restrict MDIO buses by family 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 Acked-by: Conor Dooley Link: https://patch.msgid.link/20261005074908.1273383-2-markus.stockhausen@gmx.de Signed-off-by: Jakub Kicinski --- .../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 -- knotmirror 0.0.1