[PATCH v2 0/2] 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/20210323163634.877511-1-robh@kernel.org/
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(-)
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.
Signed-off-by: Zhen Lei thunder.leizhen@huawei.com --- Documentation/devicetree/bindings/sound/renesas,rsnd.yaml | 1 - 1 file changed, 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml index 1e0e14e889133b8..384191ee497f534 100644 --- a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml @@ -258,7 +258,6 @@ required: - "#sound-dai-cells"
allOf: - - $ref: audio-graph.yaml# - if: properties: compatible:
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(+)
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$":
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
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.
Right, I'll adjust this patch again.
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
OK, thanks
- patternProperties:
'^port@[0-9]':
$ref: "#/properties/port"
Then this should be: $ref: audio-graph-port.yaml#
OK, thanks
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
.
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.
Right, I'll adjust this patch again.
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
OK, thanks
- patternProperties:
'^port@[0-9]':
$ref: "#/properties/port"
Then this should be: $ref: audio-graph-port.yaml#
OK, thanks
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
.
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
On 2021/4/9 4:42, Rob Herring wrote:
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.
Hi All: I've figured out a way to avoid both. I'll send v3 right away.
Rob
.
participants (3)
-
Leizhen (ThunderTown)
-
Rob Herring
-
Zhen Lei