Skip to contentSkip to conversation

clean up dt_binding_check and dtbs_check warnings of renesas,rsnd.yaml

PATCH Superseded Zhen Lei 2 participants 8 messages Mar 31, 2021 – Apr 12, 2021

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Zhen Lei

author
#0 lore raw

v2 cover clean up dt_binding_check and dtbs_check warnings of renesas,rsnd.yaml

It was then adjusted based on the following patch series:
[1] https://lore.kernel.org/r/[email protected]/

v1:
When I do dt_binding_check for all YAML files, below warning is reported:
/root/mainline/Documentation/devicetree/bindings/sound/renesas,rsnd.example.dt.yaml: sound@ec500000: 'dais' is a required property
From schema: /root/mainline/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml

make dt_binding_check -j24 2>err.txt
Before:
cat err.txt | wc -l
2

After:
cat err.txt | wc -l
0

make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/sound/renesas,rsnd.yaml -j24 2>err.txt Before:
cat err.txt | wc -l
130

After:
cat err.txt | wc -l
0

Zhen Lei (2):
ASoC: dt-bindings: renesas, rsnd: Clear warning 'dais' is a required
property
ASoC: dt-bindings: renesas, rsnd: Clear warning 'ports' does not match
any of the regexes

 Documentation/devicetree/bindings/sound/renesas,rsnd.yaml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Signature · 1 line
1.8.3
author
#1 lore raw

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

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. However, the dts node of this driver does not reference any property in file audio-graph.yaml. This can be proved to be true, because after I deleted "$ref: audio-graph.yaml#", the old 'dais' warnings are cleared, and no new warning are generated.

---
 Documentation/devicetree/bindings/sound/renesas,rsnd.yaml | 1 -
 1 file changed, 1 deletion(-)
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +0 -1
index 1e0e14e889133b8..384191ee497f534 100644
@@ -258,7 +258,6 @@ required:
   - "#sound-dai-cells"
 
 allOf:
-  - $ref: audio-graph.yaml#
   - if:
       properties:
         compatible:
Signature · 1 line
1.8.3
author
#2 lore raw

PATCH v2 2/2 ASoC: dt-bindings: renesas, rsnd: Clear warning 'ports' does not match any of the regexes

In reply to Zhen Lei

Currently, if there are more than two ports, or if there is only one port but other properties(such as "#address-cells") is required, these ports are placed under the "ports" node. So add the schema of property "ports".

Otherwise, warnings similar to the following will be reported:
arch/arm64/boot/dts/renesas/r8a774a1-beacon-rzg2m-kit.dt.yaml: \
sound@ec500000: 'ports' does not match any of the regexes: \
'^rcar_sound,ctu$', '^rcar_sound,dai$', '^rcar_sound,dvc$', ...

---
 Documentation/devicetree/bindings/sound/renesas,rsnd.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +5 -0
index 384191ee497f534..a42992fa687d3f3 100644
@@ -115,6 +115,11 @@ properties:
     $ref: audio-graph-port.yaml#
     unevaluatedProperties: false
 
+  ports:
+    patternProperties:
+      '^port@[0-9]':
+        $ref: "#/properties/port"
+
 # use patternProperties to avoid naming "xxx,yyy" issue
 patternProperties:
   "^rcar_sound,dvc$":
Signature · 1 line
1.8.3
maintainer
#3 lore raw

Re: [PATCH v2 2/2] ASoC: dt-bindings: renesas, rsnd: Clear warning 'ports' does not match any of the regexes

Quoted 3 lines · Zhen Lei

Currently, if there are more than two ports, or if there is only one port but other properties(such as "#address-cells") is required, these ports are placed under the "ports" node. So add the schema of property "ports".

A given binding should just use 'ports' or 'port' depending on it's need. Supporting both forms is needless complexity.

Quoted 15 lines

Otherwise, warnings similar to the following will be reported:
arch/arm64/boot/dts/renesas/r8a774a1-beacon-rzg2m-kit.dt.yaml: \
sound@ec500000: 'ports' does not match any of the regexes: \
'^rcar_sound,ctu$', '^rcar_sound,dai$', '^rcar_sound,dvc$', ...

---
 Documentation/devicetree/bindings/sound/renesas,rsnd.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +0 -0
index 384191ee497f534..a42992fa687d3f3 100644

Documentation/devicetree/bindings/sound/renesas,rsnd.yaml properties: · line 118

Quoted 4 lines
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +1 -0
@@ -115,6 +115,11 @@ properties:
     $ref: audio-graph-port.yaml#
     unevaluatedProperties: false
 
+  ports:

$ref: /schemas/graph.yaml#/properties/ports

Documentation/devicetree/bindings/sound/renesas,rsnd.yaml properties: · line 121

Quoted 3 lines
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +3 -0
+    patternProperties:
+      '^port@[0-9]':
+        $ref: "#/properties/port"

Then this should be: $ref: audio-graph-port.yaml#

Also, what each port is should be defined, but that's a separate problem.

Quoted 8 lines
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +1 -0
+
 # use patternProperties to avoid naming "xxx,yyy" issue
 patternProperties:
   "^rcar_sound,dvc$":
Signature · 1 line
1.8.3
#4 lore raw

Re: [PATCH v2 2/2] ASoC: dt-bindings: renesas, rsnd: Clear warning 'ports' does not match any of the regexes

Quoted 7 lines · Rob Herring
Quoted 3 lines · Zhen Lei

Currently, if there are more than two ports, or if there is only one port but other properties(such as "#address-cells") is required, these ports are placed under the "ports" node. So add the schema of property "ports".

A given binding should just use 'ports' or 'port' depending on it's need. Supporting both forms is needless complexity.

Right, I'll adjust this patch again.

Quoted 19 lines
Quoted 19 lines

Otherwise, warnings similar to the following will be reported:
arch/arm64/boot/dts/renesas/r8a774a1-beacon-rzg2m-kit.dt.yaml: \
sound@ec500000: 'ports' does not match any of the regexes: \
'^rcar_sound,ctu$', '^rcar_sound,dai$', '^rcar_sound,dvc$', ...

---
 Documentation/devicetree/bindings/sound/renesas,rsnd.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +0 -0
index 384191ee497f534..a42992fa687d3f3 100644
@@ -115,6 +115,11 @@ properties:
     $ref: audio-graph-port.yaml#
     unevaluatedProperties: false
 
Quoted 3 lines

Documentation/devicetree/bindings/sound/renesas,rsnd.yaml properties: · line 118

Quoted 1 line
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +1 -0
+  ports:

$ref: /schemas/graph.yaml#/properties/ports

OK, thanks

Quoted 6 lines

Documentation/devicetree/bindings/sound/renesas,rsnd.yaml properties: · line 121

Quoted 4 lines
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +3 -0
+    patternProperties:
+      '^port@[0-9]':
+        $ref: "#/properties/port"

Then this should be: $ref: audio-graph-port.yaml#

OK, thanks

Quoted 15 lines

Also, what each port is should be defined, but that's a separate problem.

Quoted 8 lines
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +1 -0
+
 # use patternProperties to avoid naming "xxx,yyy" issue
 patternProperties:
   "^rcar_sound,dvc$":
Signature · 1 line
1.8.3

.

#5 lore raw

Re: [PATCH v2 2/2] ASoC: dt-bindings: renesas, rsnd: Clear warning 'ports' does not match any of the regexes

Quoted 10 lines · Leizhen (ThunderTown)
Quoted 7 lines · Rob Herring
Quoted 3 lines · Zhen Lei

Currently, if there are more than two ports, or if there is only one port but other properties(such as "#address-cells") is required, these ports are placed under the "ports" node. So add the schema of property "ports".

A given binding should just use 'ports' or 'port' depending on it's need. Supporting both forms is needless complexity.

Hi Rob:
I don't think of a good way to avoid "port" and "ports" to be used at the same time. Should I disable the use of "port"? Convert the two usages of "port" into "ports". But usually no one will use both of them in one dts file. And even if it's used at the same time, it's not a big mistake. So I decided not to test it.

Quoted 52 lines

Right, I'll adjust this patch again.

Quoted 19 lines
Quoted 19 lines

Otherwise, warnings similar to the following will be reported:
arch/arm64/boot/dts/renesas/r8a774a1-beacon-rzg2m-kit.dt.yaml: \
sound@ec500000: 'ports' does not match any of the regexes: \
'^rcar_sound,ctu$', '^rcar_sound,dai$', '^rcar_sound,dvc$', ...

---
 Documentation/devicetree/bindings/sound/renesas,rsnd.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +0 -0
index 384191ee497f534..a42992fa687d3f3 100644
@@ -115,6 +115,11 @@ properties:
     $ref: audio-graph-port.yaml#
     unevaluatedProperties: false
 
Quoted 3 lines

Documentation/devicetree/bindings/sound/renesas,rsnd.yaml properties: · line 118

Quoted 1 line
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +1 -0
+  ports:

$ref: /schemas/graph.yaml#/properties/ports

OK, thanks

Quoted 6 lines

Documentation/devicetree/bindings/sound/renesas,rsnd.yaml properties: · line 121

Quoted 4 lines
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +3 -0
+    patternProperties:
+      '^port@[0-9]':
+        $ref: "#/properties/port"

Then this should be: $ref: audio-graph-port.yaml#

OK, thanks

Quoted 15 lines

Also, what each port is should be defined, but that's a separate problem.

Quoted 8 lines
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +1 -0
+
 # use patternProperties to avoid naming "xxx,yyy" issue
 patternProperties:
   "^rcar_sound,dvc$":
Signature · 1 line
1.8.3

.

maintainer
#6 lore raw

Re: [PATCH v2 2/2] ASoC: dt-bindings: renesas, rsnd: Clear warning 'ports' does not match any of the regexes

Quoted 11 lines · Leizhen (ThunderTown)
Quoted 8 lines · Leizhen (ThunderTown)
Quoted 5 lines · Rob Herring
Quoted 3 lines · Zhen Lei

Currently, if there are more than two ports, or if there is only one port but other properties(such as "#address-cells") is required, these ports are placed under the "ports" node. So add the schema of property "ports".

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

A given binding should just use 'ports' or 'port' depending on it's need. Supporting both forms is needless complexity.

Hi Rob:
I don't think of a good way to avoid "port" and "ports" to be used at the same time. Should I disable the use of "port"? Convert the two usages of "port" into "ports". But usually no one will use both of them in one dts file. And even if it's used at the same time, it's not a big mistake. So I decided not to test it.

I think the Renesas folks need to comment on this.

Rob

#7 lore raw

Re: [PATCH v2 2/2] ASoC: dt-bindings: renesas, rsnd: Clear warning 'ports' does not match any of the regexes

Quoted 15 lines · Rob Herring
Quoted 14 lines · Leizhen (ThunderTown)
Quoted 10 lines · Leizhen (ThunderTown)
Quoted 7 lines · Rob Herring
Quoted 3 lines · Zhen Lei

Currently, if there are more than two ports, or if there is only one port but other properties(such as "#address-cells") is required, these ports are placed under the "ports" node. So add the schema of property "ports".

A given binding should just use 'ports' or 'port' depending on it's need. Supporting both forms is needless complexity.

Quoted 7 lines
Quoted 5 lines

Hi Rob:
I don't think of a good way to avoid "port" and "ports" to be used at the same time. Should I disable the use of "port"? Convert the two usages of "port" into "ports". But usually no one will use both of them in one dts file. And even if it's used at the same time, it's not a big mistake. So I decided not to test it.

I think the Renesas folks need to comment on this.

Hi All:
I've figured out a way to avoid both. I'll send v3 right away.

Quoted 5 lines

Rob

.