Skip to content

Commit

Permalink
ASoC: dt-bindings: Simplify port schema
Browse files Browse the repository at this point in the history
The use of 'definitions' is not necessary and also problematic because the
dtschema tools don't process 'definitions' resulting in this spurious
warning:

Documentation/devicetree/bindings/sound/renesas,rsnd.example.dtb: sound@ec500000: port:endpoint: Unevaluated properties are not allowed ('phandle' was unexpected)
        from schema $id: http://devicetree.org/schemas/sound/renesas,rsnd.yaml#

Fix this by moving the port schema to #/properties/port and referencing
that directly from the 'ports' schema.

Really, a binding should just always use 'ports' if multiple ports are
possible. There's no benefit to supporting both forms. However, it appears
there are already lots of users of this one with a single 'port' node.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231101140923.16344-2-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
robherring authored and broonie committed Nov 13, 2023
1 parent 970f88a commit 6d02f35
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,6 @@ title: Renesas R-Car Sound Driver
maintainers:
- Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

definitions:
port-def:
$ref: audio-graph-port.yaml#/definitions/port-base
unevaluatedProperties: false
patternProperties:
"^endpoint(@[0-9a-f]+)?":
$ref: audio-graph-port.yaml#/definitions/endpoint-base
properties:
playback:
$ref: /schemas/types.yaml#/definitions/phandle-array
capture:
$ref: /schemas/types.yaml#/definitions/phandle-array
unevaluatedProperties: false

properties:

compatible:
Expand Down Expand Up @@ -125,7 +111,17 @@ properties:

# ports is below
port:
$ref: "#/definitions/port-def"
$ref: audio-graph-port.yaml#/definitions/port-base
unevaluatedProperties: false
patternProperties:
"^endpoint(@[0-9a-f]+)?":
$ref: audio-graph-port.yaml#/definitions/endpoint-base
properties:
playback:
$ref: /schemas/types.yaml#/definitions/phandle-array
capture:
$ref: /schemas/types.yaml#/definitions/phandle-array
unevaluatedProperties: false

rcar_sound,dvc:
description: DVC subnode.
Expand Down Expand Up @@ -269,7 +265,7 @@ patternProperties:
unevaluatedProperties: false
patternProperties:
'^port(@[0-9a-f]+)?$':
$ref: "#/definitions/port-def"
$ref: "#/properties/port"

required:
- compatible
Expand Down

0 comments on commit 6d02f35

Please sign in to comment.