Re: [PATCH net-next v4 1/5] dt-bindings: net: realtek,rtl9301-mdio: restrict MDIO buses by family
From: Rob Herring <robh@kernel.org>
Date: 2026-09-24 14:46:24
Also in:
linux-devicetree
On Wed, Sep 16, 2026 at 01:35:10PM +0000, netdev-bot+sashiko@kernel.org wrote:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: Critical: 0 · High: 0 · Medium: 1 · Low: 0 - [Medium] Incomplete constraint: the new per-family `allOf`/`if-then` blocks in… -- dt-bindings: net: realtek,rtl9301-mdio: restrict MDIO buses by family This adds two per-family conditional blocks to the Realtek Otto MDIO controller binding so that mdio-bus child node names are limited to the number of buses each family has: one for RTL838x, two for RTL839x and four for RTL930x/RTL931x.quoted
diff --git a/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml b/Documentation/devicetree/bindings/net/realtek,rtl9301-mdio.yaml index 67e0b23a8470e..7f5b4897487b2 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[Severity: Medium] These two conditionals only reject child node names, but the bus index the driver consumes is the child's reg value. Should the same conditionals also bound reg?
No. Ideally we would check reg vs. unit-addresses which would prevent anything out of range and/or mismatched. However, there are gaps in that checking currently. Rob