diff mbox series

[1/2] ASoC: dt-bindings: renesas, rsnd: Clear warning 'dais' is a required property

Message ID 20210330030631.2253-2-thunder.leizhen@huawei.com
State New
Headers show
Series clean up dt_binding_check and dtbs_check warnings of renesas,rsnd.yaml | expand

Commit Message

Leizhen (ThunderTown) March 30, 2021, 3:06 a.m. UTC
When I do dt_binding_check, below warning is reported:
Documentation/devicetree/bindings/sound/renesas,rsnd.example.dt.yaml: \
sound@ec500000: 'dais' is a required property

I looked at all the dts files in the "arch/arm64/boot/dts/renesas/"
directory, I found that all nodes that contain the "dais" property have
compatible string: "audio-graph-card". So I can be sure that the
"$ref: audio-graph.yaml#" should be corrected to
"$ref: audio-graph-card.yaml#".

In addition, not all nodes have compatible string "audio-graph-card", so
the "$ref: audio-graph-card.yaml#" should be described as "anyOf". To
ensure the validation of "anyOf" always passes, group it with the "if"
statement, because the result of the "if" statement is always not empty.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>

---
 Documentation/devicetree/bindings/sound/renesas,rsnd.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
1.8.3

Comments

Rob Herring (Arm) March 30, 2021, 10:45 p.m. UTC | #1
On Tue, Mar 30, 2021 at 11:06:30AM +0800, Zhen Lei wrote:
> When I do dt_binding_check, below warning is reported:

> Documentation/devicetree/bindings/sound/renesas,rsnd.example.dt.yaml: \

> sound@ec500000: 'dais' is a required property

> 

> I looked at all the dts files in the "arch/arm64/boot/dts/renesas/"

> directory, I found that all nodes that contain the "dais" property have

> compatible string: "audio-graph-card". So I can be sure that the

> "$ref: audio-graph.yaml#" should be corrected to

> "$ref: audio-graph-card.yaml#".

> 

> In addition, not all nodes have compatible string "audio-graph-card", so

> the "$ref: audio-graph-card.yaml#" should be described as "anyOf". To

> ensure the validation of "anyOf" always passes, group it with the "if"

> statement, because the result of the "if" statement is always not empty.


'anyOf' is probably not right here.

In any case, the is going to conflict with my series[1].

Rob

[1] https://lore.kernel.org/r/20210323163634.877511-1-robh@kernel.org/
Leizhen (ThunderTown) March 31, 2021, 2:25 a.m. UTC | #2
On 2021/3/31 6:45, Rob Herring wrote:
> On Tue, Mar 30, 2021 at 11:06:30AM +0800, Zhen Lei wrote:

>> When I do dt_binding_check, below warning is reported:

>> Documentation/devicetree/bindings/sound/renesas,rsnd.example.dt.yaml: \

>> sound@ec500000: 'dais' is a required property

>>

>> I looked at all the dts files in the "arch/arm64/boot/dts/renesas/"

>> directory, I found that all nodes that contain the "dais" property have

>> compatible string: "audio-graph-card". So I can be sure that the

>> "$ref: audio-graph.yaml#" should be corrected to

>> "$ref: audio-graph-card.yaml#".

>>

>> In addition, not all nodes have compatible string "audio-graph-card", so

>> the "$ref: audio-graph-card.yaml#" should be described as "anyOf". To

>> ensure the validation of "anyOf" always passes, group it with the "if"

>> statement, because the result of the "if" statement is always not empty.

> 

> 'anyOf' is probably not right here.


Oh, yes, I think I should use "if" statement to enumerate cases where
"audio-graph-card.yaml" is required.

> 

> In any case, the is going to conflict with my series[1].


OK, I'll rework my patch based on your series.

> 

> Rob

> 

> [1] https://lore.kernel.org/r/20210323163634.877511-1-robh@kernel.org/

> 

> .

>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
index 2e1046513603ed0..487aeabd1f0e65b 100644
--- a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
+++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
@@ -256,8 +256,10 @@  required:
   - "#sound-dai-cells"
 
 allOf:
-  - $ref: audio-graph.yaml#
   - $ref: audio-graph-port.yaml#
+
+anyOf:
+  - $ref: audio-graph-card.yaml#
   - if:
       properties:
         compatible: