Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Krzysztof Kozlowski" <krzysztof.kozlowski@oss.qualcomm.com>,
	devicetree@vger.kernel.org
Cc: robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2] dt-bindings: example-schema: Show example of dependentRequired
Date: Wed, 11 Nov 2026 11:26:42 +0000	[thread overview]
Message-ID: <sashiko-outbox-208873@kernel.org> (raw)
In-Reply-To: <20261111111403.83665-2-krzysztof.kozlowski@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] dt-bindings: example-schema: duplicate dependencies and
  dependentRequired
--

commit 1be156d7b94f469cc7bb5216878b759c591f8b64
Author: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

dt-bindings: example-schema: Show example of dependentRequired

This commit adds a dependentRequired block to example-schema.yaml to
demonstrate conditional property requirements.

> diff --git a/Documentation/devicetree/bindings/example-schema.yaml b/Documentation/devicetree/bindings/example-schema.yaml
> index b04f3cc4312c0..a37d10ff7469a 100644
> --- a/Documentation/devicetree/bindings/example-schema.yaml
> +++ b/Documentation/devicetree/bindings/example-schema.yaml
> @@ -217,6 +217,14 @@ required:
>    - interrupts
>    - interrupt-controller
>  
> +# Properties might be required only if some other property is present.
> +# dependentRequired is a shorter and preferred way to express this, instead of
> +# if:then: block.
> +dependentRequired:
> +  # clocks is not a required property in this binding, but if present, then
> +  # clock-names must be provided as well.
> +  clocks: [ clock-names ]
> +
>  # if/then schema can be used to handle conditions on a property affecting
>  # another property. A typical case is a specific 'compatible' value changes the
>  # constraints on other properties.

[Severity: Low]
Should this replace the existing dependencies block just above required
instead of adding a second section for the same construct?

example-schema.yaml already demonstrates conditional property presence under
the Draft-07 dependencies keyword (which is also referenced in the allOf
comment below), so keeping both leaves the example showing the legacy and
Draft 2019-09 keywords side by side.

Also, requiring clock-names whenever clocks is present conflicts with the
clocks and clock-names definitions earlier in this file, where clocks has
maxItems: 1 and the comment on clock-names advises skipping xxx-names for
single-entry lists.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261111111403.83665-2-krzysztof.kozlowski@oss.qualcomm.com?part=1

  reply	other threads:[~2026-11-11 11:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 11:14 [PATCH v2] dt-bindings: example-schema: Show example of dependentRequired Krzysztof Kozlowski
2026-11-11 11:26 ` sashiko-bot [this message]
2026-11-11 17:21 ` Rob Herring
2026-11-11 18:16   ` Krzysztof Kozlowski

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=sashiko-outbox-208873@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski@oss.qualcomm.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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