diff mbox series

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

Message ID 20210331091616.2306-3-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 31, 2021, 9:16 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$', ...

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

Comments

Rob Herring April 1, 2021, 8:20 p.m. UTC | #1
On Wed, Mar 31, 2021 at 05:16:16PM +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".

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

> 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$', ...
> 
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
>  Documentation/devicetree/bindings/sound/renesas,rsnd.yaml | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
> index 384191ee497f534..a42992fa687d3f3 100644
> --- a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
> +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
> @@ -115,6 +115,11 @@ properties:
>      $ref: audio-graph-port.yaml#
>      unevaluatedProperties: false
>  
> +  ports:

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

> +    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.

> +
>  # use patternProperties to avoid naming "xxx,yyy" issue
>  patternProperties:
>    "^rcar_sound,dvc$":
> -- 
> 1.8.3
> 
>
Rob Herring April 8, 2021, 8:42 p.m. UTC | #2
On Thu, Apr 08, 2021 at 08:28:08PM +0800, Leizhen (ThunderTown) wrote:
> 
> 
> On 2021/4/7 10:04, Leizhen (ThunderTown) wrote:
> > 
> > 
> > On 2021/4/2 4:20, Rob Herring wrote:
> >> On Wed, Mar 31, 2021 at 05:16:16PM +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".
> >>
> >> 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
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
index 384191ee497f534..a42992fa687d3f3 100644
--- a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
+++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
@@ -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$":