Skip to content

Commit

Permalink
dt-bindings: Remove more cases of 'allOf' containing a '$ref'
Browse files Browse the repository at this point in the history
Another round of 'allOf' removals that came in this cycle.

json-schema versions draft7 and earlier have a weird behavior in that
any keywords combined with a '$ref' are ignored (silently). The correct
form was to put a '$ref' under an 'allOf'. This behavior is now changed
in the 2019-09 json-schema spec and '$ref' can be mixed with other
keywords. The json-schema library doesn't yet support this, but the
tooling now does a fixup for this and either way works.

This has been a constant source of review comments, so let's change this
treewide so everyone copies the simpler syntax.

Signed-off-by: Rob Herring <[email protected]>
  • Loading branch information
robherring committed Jun 11, 2020
1 parent 2dca74a commit 086e907
Show file tree
Hide file tree
Showing 33 changed files with 224 additions and 316 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ properties:
CPU power good signal from external PMIC to PMC is enabled.

nvidia,suspend-mode:
allOf:
- $ref: /schemas/types.yaml#/definitions/uint32
- enum: [0, 1, 2]
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1, 2]
description:
The suspend mode that the platform should use.
Mode 0 is for LP0, CPU + Core voltage off and DRAM in self-refresh
Expand Down
21 changes: 9 additions & 12 deletions Documentation/devicetree/bindings/ata/sata_highbank.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,25 @@ properties:
calxeda,led-order:
description: Maps port numbers to offsets within the SGPIO bitstream.
allOf:
- $ref: /schemas/types.yaml#/definitions/uint32-array
- minItems: 1
maxItems: 8
$ref: /schemas/types.yaml#/definitions/uint32-array
minItems: 1
maxItems: 8

calxeda,port-phys:
description: |
phandle-combophy and lane assignment, which maps each SATA port to a
combophy and a lane within that combophy
allOf:
- $ref: /schemas/types.yaml#/definitions/phandle-array
- minItems: 1
maxItems: 8
$ref: /schemas/types.yaml#/definitions/phandle-array
minItems: 1
maxItems: 8

calxeda,tx-atten:
description: |
Contains TX attenuation override codes, one per port.
The upper 24 bits of each entry are always 0 and thus ignored.
allOf:
- $ref: /schemas/types.yaml#/definitions/uint32-array
- minItems: 1
maxItems: 8
$ref: /schemas/types.yaml#/definitions/uint32-array
minItems: 1
maxItems: 8

calxeda,sgpio-gpio:
description: |
Expand Down
7 changes: 3 additions & 4 deletions Documentation/devicetree/bindings/gpio/snps,dw-apb-gpio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@ patternProperties:

snps,nr-gpios:
description: The number of GPIO pins exported by the port.
$ref: /schemas/types.yaml#/definitions/uint32
default: 32
allOf:
- $ref: /schemas/types.yaml#/definitions/uint32
- minimum: 1
maximum: 32
minimum: 1
maximum: 32

interrupts:
description: |
Expand Down
3 changes: 1 addition & 2 deletions Documentation/devicetree/bindings/iio/imu/adi,adis16475.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ properties:
1 - direct_sync
2 - scaled_sync
3 - pulse_sync
allOf:
- $ref: /schemas/types.yaml#/definitions/uint32
$ref: /schemas/types.yaml#/definitions/uint32
minimum: 0
maximum: 3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ properties:

amstaos,cover-comp-gain:
description: Multiplier for gain compensation
allOf:
- $ref: /schemas/types.yaml#/definitions/uint32
- enum: [1, 16]
$ref: /schemas/types.yaml#/definitions/uint32
enum: [1, 16]

required:
- compatible
Expand Down
Loading

0 comments on commit 086e907

Please sign in to comment.