[PATCH 3/3] dt-bindings: regulator: Fix yaml verification for fixed-regulator schema

From: Alexandre Torgue
Date: Mon Oct 07 2019 - 06:26:20 EST


This commit fixes an issue seen during yaml check ("make dt_binding_check").
Compatible didn't seem to be seen as a string.

Reported issue:
"properties:compatible:enum:0: {'const': 'regulator-fixed'}
is not of type 'string'"
And
"properties:compatible:enum:1: {'const': 'regulator-fixed-clock'}
is not of type 'string'"

Fixes: 9c86d003d620 ("dt-bindings: regulator: add regulator-fixed-clock binding")
Signed-off-by: Alexandre Torgue <alexandre.torgue@xxxxxx>

diff --git a/Documentation/devicetree/bindings/regulator/fixed-regulator.yaml b/Documentation/devicetree/bindings/regulator/fixed-regulator.yaml
index a78150c47aa2..7725cedf1538 100644
--- a/Documentation/devicetree/bindings/regulator/fixed-regulator.yaml
+++ b/Documentation/devicetree/bindings/regulator/fixed-regulator.yaml
@@ -22,16 +22,20 @@ allOf:
if:
properties:
compatible:
+ allOf:
+ - $ref: "/schemas/types.yaml#/definitions/string"
contains:
- const: regulator-fixed-clock
+ const: "regulator-fixed-clock"
required:
- clocks

properties:
compatible:
+ allOf:
+ - $ref: "/schemas/types.yaml#/definitions/string"
enum:
- - const: regulator-fixed
- - const: regulator-fixed-clock
+ - "regulator-fixed"
+ - "regulator-fixed-clock"

regulator-name: true

--
2.17.1