diff mbox series

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

Message ID 20210412100638.3349-3-thunder.leizhen@huawei.com (mailing list archive)
State New, archived
Headers show
Series clean up dt_binding_check and dtbs_check warnings of renesas, rsnd.yaml | expand

Commit Message

Zhen Lei April 12, 2021, 10:06 a.m. UTC
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$', ...

A given binding should just use 'ports' or 'port' depending on it's need.
Both are not allowed at the same time. The check is done in "allOf".

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 .../devicetree/bindings/sound/renesas,rsnd.yaml      | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Rob Herring April 15, 2021, 8:36 p.m. UTC | #1
On Mon, 12 Apr 2021 18:06:38 +0800, Zhen Lei wrote:
> 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$', ...
> 
> A given binding should just use 'ports' or 'port' depending on it's need.
> Both are not allowed at the same time. The check is done in "allOf".
> 
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
>  .../devicetree/bindings/sound/renesas,rsnd.yaml      | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 

Reviewed-by: Rob Herring <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 384191ee497f534..32b10fc3789eeac 100644
--- a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
+++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
@@ -115,6 +115,12 @@  properties:
     $ref: audio-graph-port.yaml#
     unevaluatedProperties: false
 
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+    patternProperties:
+      '^port@[0-9]':
+        $ref: audio-graph-port.yaml#
+
 # use patternProperties to avoid naming "xxx,yyy" issue
 patternProperties:
   "^rcar_sound,dvc$":
@@ -258,6 +264,12 @@  required:
   - "#sound-dai-cells"
 
 allOf:
+  - if:
+      required:
+        - ports
+    then:
+      properties:
+        port: false
   - if:
       properties:
         compatible: