[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y4WDgL8k9uDsVx4X@euler>
Date: Mon, 28 Nov 2022 19:58:56 -0800
From: Colin Foster <colin.foster@...advantage.com>
To: Rob Herring <robh@...nel.org>
Cc: linux-renesas-soc@...r.kernel.org,
linux-mediatek@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, netdev@...r.kernel.org,
John Crispin <john@...ozen.org>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Claudiu Manoil <claudiu.manoil@....com>,
Marek Vasut <marex@...x.de>,
Sean Wang <sean.wang@...iatek.com>,
DENG Qingfang <dqfext@...il.com>,
Landen Chao <Landen.Chao@...iatek.com>,
nç ÜNAL <arinc.unal@...nc9.com>,
Vivien Didelot <vivien.didelot@...il.com>,
Clément Léger <clement.leger@...tlin.com>,
Alvin Šipraga <alsi@...g-olufsen.dk>,
Linus Walleij <linus.walleij@...aro.org>,
UNGLinuxDriver@...rochip.com,
Woojung Huh <woojung.huh@...rochip.com>,
Matthias Brugger <matthias.bgg@...il.com>,
Kurt Kanzenbach <kurt@...utronix.de>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Paolo Abeni <pabeni@...hat.com>,
Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
Vladimir Oltean <olteanv@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Andrew Lunn <andrew@...n.ch>,
George McCollister <george.mccollister@...il.com>
Subject: Re: [PATCH v3 net-next 03/10] dt-bindings: net: dsa: utilize base
definitions for standard dsa switches
On Tue, Nov 29, 2022 at 01:34:52AM -0800, Colin Foster wrote:
> Hi Rob,
>
> On Mon, Nov 28, 2022 at 05:23:37PM -0600, Rob Herring wrote:
> > On Sun, Nov 27, 2022 at 02:47:27PM -0800, Colin Foster wrote:
> > > diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.yaml b/Documentation/devicetree/bindings/net/dsa/dsa.yaml
> > > index b9d48e357e77..bd1f0f7c14a8 100644
> > > --- a/Documentation/devicetree/bindings/net/dsa/dsa.yaml
> > > +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml
> > > @@ -19,9 +19,6 @@ description:
> > > select: false
> > >
> > > properties:
> > > - $nodename:
> > > - pattern: "^(ethernet-)?switch(@.*)?$"
> > > -
> > > dsa,member:
> > > minItems: 2
> > > maxItems: 2
> > > @@ -58,4 +55,20 @@ oneOf:
> > >
> > > additionalProperties: true
> > >
> > > +$defs:
> > > + base:
> > > + description: A DSA switch without any extra port properties
> > > + $ref: '#/'
> > > +
> > > + patternProperties:
> > > + "^(ethernet-)?ports$":
> >
> > This node at the top level needs 'additionalProperties: false' assuming
> > we don't allow extra properties in 'ports' nodes. If we do, then we'll
> > need to be able to reference the 'ports' schema to extend it like is
> > done with dsa-ports.yaml.
>
> I'll double check if there's anything that adds any properties. If there
> is, would that be a separate file pair: "dsa-ports.yaml" and
> "ethernet-switch-ports.yaml"? Or do you think that could be contained in
> the existing dsa.yaml, ethernet-switch.yaml?
I came up with this change. It also fixes my accidental 's' affix to
^(ethernet-)port@[0-9]+.
diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.yaml b/Documentation/devicetree/bindings/net/dsa/dsa.yaml
index 616753ba85a2..c1900363a6ab 100644
--- a/Documentation/devicetree/bindings/net/dsa/dsa.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml
@@ -41,12 +41,18 @@ $defs:
patternProperties:
"^(ethernet-)?ports$":
type: object
+ additionalProperties: false
+
+ properties:
+ '#address-cells':
+ const: 1
+ '#size-cells':
+ const: 0
patternProperties:
- "^(ethernet-)?ports@[0-9]+$":
+ "^(ethernet-)?port@[0-9]+$":
description: Ethernet switch ports
$ref: dsa-port.yaml#
unevaluatedProperties: false
-
...
Powered by blists - more mailing lists