Re: [PATCH net-next v4 05/14] dt-bindings: net: dsa: renesas,rzn1-a5psw: Disallow ports beyond port@4
From: Lad, Prabhakar
Date: Thu Nov 12 2026 - 07:44:11 EST
Hi Rob,
Thank you for the review.
On Fri, Nov 6, 2026 at 3:44 PM Rob Herring <robh@xxxxxxxxxx> wrote:
>
> On Wed, Nov 04, 2026 at 06:20:53PM +0000, Prabhakar wrote:
> > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
> >
> > Restrict the A5PSW ethernet-ports node to ports 0 through 4, matching the
> > hardware configuration of four external ports and one CPU/management port.
> >
> > Although the schema pattern limits port nodes to port@0 through port@4,
> > additionalProperties: true allows other port nodes to pass validation.
> > Set additionalProperties to false and explicitly allow #address-cells
> > and #size-cells so that ports beyond port@4 are rejected.
> >
> > Existing in-tree device trees describe only port@0 through port@4 and
> > are unaffected by this change.
> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
> > ---
> > v3->v4:
> > - Added reg items validation for ethernet ports
> >
> > v2->v3:
> > - New patch
> > ---
> > .../bindings/net/dsa/renesas,rzn1-a5psw.yaml | 12 +++++++++++-
> > 1 file changed, 11 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
> > index 9c477ceb170b..250c59e58439 100644
> > --- a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
> > +++ b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
> > @@ -63,12 +63,22 @@ properties:
> >
> > ethernet-ports:
> > type: object
> > - additionalProperties: true
> > + additionalProperties: false
> > +
> > + properties:
> > + '#address-cells':
> > + const: 1
> > + '#size-cells':
> > + const: 0
> > +
>
> Drop all this.
>
> > patternProperties:
> > "^(ethernet-)?port@[0-4]$":
>
> And make this "^(ethernet-)?port@". Then any node will get the 'reg'
> schema applied. That doesn't check the unit-address, but the way to
> check that is comparing it to the reg value (not yet implemented except
> for specific buses in dtc).
>
Good point.
>
> > type: object
> > additionalProperties: true
> > properties:
> > + reg:
> > + items:
> > + - maximum: 4
Here I can drop items and just have something like below:
properties:
+ reg:
+ maximum: 4
Cheers,
Prabhakar
> > pcs-handle:
> > maxItems: 1
> > description:
> > --
> > 2.56.0
> >