devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: "Arınç ÜNAL" <arinc.unal@arinc9.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Lorenzo Bianconi <lorenzo@kernel.org>,
	Felix Fietkau <nbd@nbd.name>,
	Daniel Golle <daniel@makrotopia.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	mithat.guner@xeront.com, erkin.bozoglu@xeront.com,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH net-next 2/2] dt-bindings: net: mediatek,net: move mediatek,mt7621-eth to another schema
Date: Mon, 18 Sep 2023 15:29:51 -0500	[thread overview]
Message-ID: <20230918202951.GA1712467-robh@kernel.org> (raw)
In-Reply-To: <20230917124723.143202-2-arinc.unal@arinc9.com>

On Sun, Sep 17, 2023 at 03:47:23PM +0300, Arınç ÜNAL wrote:
> The bindings for mediatek,mt7621-eth contradict with some of the rules on
> the top level schema of mediatek,net.yaml:
> - resets must be two items. resets with "maxItems: 3" at the top level
>   implies "minItems: 3" and cannot be overriden under a subschema.
> - reset-names items must be "fe" and "eth". reset-names items defined on
>   the top level schema cannot be overridden under a subschema.

Why not? You can shuffle things around. Though at some point it is worth 
splitting the schemas.

> 
> Therefore, move mediatek,mt7621-eth to another schema. Fix the order of
> clock-names items. Do not define the properties that don't apply to this
> hardware. Require more properties. Add an example.
> 
> Fixes: 1cbf487d7d3a ("dt-bindings: net: mediatek,net: add missing mediatek,mt7621-eth")
> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
> ---
>  .../bindings/net/mediatek,mt7621-eth.yaml     | 143 ++++++++++++++++++
>  .../devicetree/bindings/net/mediatek,net.yaml |  27 ----
>  2 files changed, 143 insertions(+), 27 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/net/mediatek,mt7621-eth.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/mediatek,mt7621-eth.yaml b/Documentation/devicetree/bindings/net/mediatek,mt7621-eth.yaml
> new file mode 100644
> index 000000000000..4f39d7124693
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/mediatek,mt7621-eth.yaml
> @@ -0,0 +1,143 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/mediatek,mt7621-eth.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MediaTek MT7621 Frame Engine Ethernet controller
> +
> +maintainers:
> +  - Arınç ÜNAL <arinc.unal@arinc9.com>
> +
> +description:
> +  The frame engine ethernet controller can be found on MediaTek MT7621 SoC. This
> +  SoC has got dual GMAC ports.
> +
> +properties:
> +  compatible:
> +    const: mediatek,mt7621-eth
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 2
> +
> +  clock-names:
> +    items:
> +      - const: fe
> +      - const: ethif
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  resets:
> +    maxItems: 2
> +
> +  reset-names:
> +    items:
> +      - const: fe
> +      - const: eth
> +
> +  mediatek,ethsys:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description:
> +      Phandle to the syscon node that handles the port setup.
> +
> +  mdio-bus:
> +    $ref: mdio.yaml#
> +    unevaluatedProperties: false
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 0
> +
> +patternProperties:
> +  "^mac@[0-1]$":
> +    type: object
> +    unevaluatedProperties: false
> +    allOf:

Don't need allOf.

> +      - $ref: ethernet-controller.yaml#
> +    description:
> +      Ethernet MAC node
> +    properties:
> +      compatible:
> +        const: mediatek,eth-mac
> +
> +      reg:
> +        maxItems: 1
> +
> +    required:
> +      - reg
> +      - compatible

Now all the child nodes (at least) are duplicated. If you don't want to 
further extend the if/then schemas (it's a judgement call when splitting 
makes sense), then I'd suggest you move what is common to a separate 
schema file and then $ref it in this file and the original schema.

Rob

  reply	other threads:[~2023-09-18 20:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-17 12:47 [PATCH net-next 1/2] dt-bindings: net: mediatek,net: remove reference on top level schema Arınç ÜNAL
2023-09-17 12:47 ` [PATCH net-next 2/2] dt-bindings: net: mediatek,net: move mediatek,mt7621-eth to another schema Arınç ÜNAL
2023-09-18 20:29   ` Rob Herring [this message]
2023-09-18 20:30 ` [PATCH net-next 1/2] dt-bindings: net: mediatek,net: remove reference on top level schema Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230918202951.GA1712467-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=arinc.unal@arinc9.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=erkin.bozoglu@xeront.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=lorenzo@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mithat.guner@xeront.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).