From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
Linux-DT <devicetree@vger.kernel.org>,
Linux-ALSA <alsa-devel@alsa-project.org>,
Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH v3 2/2] ASoC: dt-bindings: renesas,rsnd.yaml: add R-Car Gen4 support
Date: Thu, 16 Feb 2023 08:49:56 +0100 [thread overview]
Message-ID: <a9d5d375-697d-93c8-0bed-4d2475e6643e@linaro.org> (raw)
In-Reply-To: <873576ju10.wl-kuninori.morimoto.gx@renesas.com>
On 16/02/2023 02:09, Kuninori Morimoto wrote:
>
> Hi Krzysztof
>
>> If you leave the top-level definition without any constraints and you
>> forget to include all your compatibles in allOf:if:then, then you end up
>> without constraints. Consider:
> (snip)
>> -----
>> properties:
>> compatible:
>> enum:
>> - foo
>> - bar
>>
>> clock-names:
>> description: anything
>>
>> if:
>> prop:
>> compat:
>> enum:
>> - foo
>> then:
>> prop:
>> clock-names:
>> - ahb
>> - sclk
>> -----
>>
>> What clocks are valid for bar?
>>
>> For simple cases this might be obvious, for more complex this is easy to
>> miss. So the recommended syntax is with constraints at the top.
>
> I can understand we want to avoid the future miss.
> But I did it on v2 patch and you NACKed it.
No, you did not do it in v2. The top-level property is a must, we talk
now about constraints.
> Thus people confused. That is the reason why above strange style was created.
> And it is already using "else", your concern never happen ?
Yes, with else my concern will never happen. However you have there
multiple ifs, thus finding the one related to clocks is not obvious now
and won't be anyhow easier later. What's more, clocks have constraints
in top-level, thus seeing clock-names without the constraints also
raises reviewers question. Someone might bring a new compatible with
another set of clocks (quite likely), thus else won't be valid anymore
and you will have to define constraints per *each* variant (each
if:then:). When this happens, please move the widest constraints to
top-level, just like I was asking since some time. Will you remember to
do this? I might not because I assume we follow same pattern everywhere.
With a promise of above:
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
next prev parent reply other threads:[~2023-02-16 7:50 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-13 2:12 [PATCH v3 0/2] ASoC: dt-bindings: renesas,rsnd.yaml: add R-Car Gen4 support Kuninori Morimoto
2023-02-13 2:13 ` [PATCH v3 2/2] " Kuninori Morimoto
2023-02-13 8:58 ` Krzysztof Kozlowski
2023-02-14 17:52 ` Mark Brown
2023-02-15 18:42 ` Krzysztof Kozlowski
2023-02-16 1:09 ` Kuninori Morimoto
2023-02-16 7:49 ` Krzysztof Kozlowski [this message]
2023-02-17 1:09 ` Kuninori Morimoto
2023-03-16 14:28 ` Rafał Miłecki
2023-03-16 23:44 ` Kuninori Morimoto
2023-03-17 8:19 ` Krzysztof Kozlowski
2023-02-13 2:13 ` [PATCH v3 1/2] ASoC: dt-bindings: renesas,rsnd.yaml: drop "dmas/dma-names" from "rcar_sound,ssi" Kuninori Morimoto
2023-02-13 8:56 ` Krzysztof Kozlowski
2023-02-13 8:56 ` Geert Uytterhoeven
2023-02-13 8:56 ` Krzysztof Kozlowski
2023-02-13 23:21 ` Kuninori Morimoto
2023-02-14 22:54 ` (subset) [PATCH v3 0/2] ASoC: dt-bindings: renesas,rsnd.yaml: add R-Car Gen4 support Mark Brown
2023-03-06 13:32 ` Mark Brown
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=a9d5d375-697d-93c8-0bed-4d2475e6643e@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=geert@linux-m68k.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=robh@kernel.org \
/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).