Skip to contentSkip to conversation

dt-bindings: Remove more cases of 'allOf' containing a '$ref'

PATCH New Rob Herring 1 participant 1 message Aug 14, 2020

Subsystems (14)
lore
Share & tools
lore

Rob Herring

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: Remove more cases of 'allOf' containing a '$ref'

Another wack-a-mole pass of killing off unnecessary 'allOf + $ref' usage.

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.

---
 .../bindings/display/brcm,bcm2835-hdmi.yaml   |  3 +-
 .../bindings/iio/adc/qcom,spmi-vadc.yaml      |  3 +-
 .../interrupt-controller/mti,gic.yaml         | 28 ++++++------
 .../bindings/media/i2c/dongwoon,dw9768.yaml   | 43 +++++++++----------
 .../bindings/pci/ti,j721e-pci-ep.yaml         |  3 +-
 .../bindings/pci/ti,j721e-pci-host.yaml       |  3 +-
 .../bindings/sound/maxim,max98390.yaml        |  6 +--
 .../bindings/sound/nvidia,tegra186-dspk.yaml  |  3 +-
 .../bindings/sound/nvidia,tegra210-dmic.yaml  |  3 +-
 .../bindings/sound/nvidia,tegra210-i2s.yaml   |  3 +-
 .../bindings/sound/ti,j721e-cpb-audio.yaml    |  6 +--
 .../sound/ti,j721e-cpb-ivi-audio.yaml         | 15 +++----
 12 files changed, 49 insertions(+), 70 deletions(-)
Documentation/devicetree/bindings/display/brcm,bcm2835-hdmi.yaml +1 -2
index 52b3cdac0bdf..f54b4e4808f0 100644
@@ -32,8 +32,7 @@ properties:
       - const: hdmi
 
   ddc:
-    allOf:
-      - $ref: /schemas/types.yaml#/definitions/phandle
+    $ref: /schemas/types.yaml#/definitions/phandle
     description: >
       Phandle of the I2C controller used for DDC EDID probing
 
Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.yaml +1 -2
index a6ac289d98da..0ca992465a21 100644
@@ -97,8 +97,7 @@ patternProperties:
             input signal is multiplied. For example, <1 3> indicates the signal is scaled
             down to 1/3 of its value before ADC measurement.
             If property is not found default value depending on chip will be used.
-        allOf:
-          - $ref: /schemas/types.yaml#/definitions/uint32-array
+        $ref: /schemas/types.yaml#/definitions/uint32-array
         oneOf:
           - items:
               - const: 1
Documentation/devicetree/bindings/interrupt-controller/mti,gic.yaml +13 -15
index 9f0eb3addac4..ce6aaff15214 100644
@@ -42,14 +42,13 @@ properties:
       Specifies the list of CPU interrupt vectors to which the GIC may not
       route interrupts. This property is ignored if the CPU is started in EIC
       mode.
-    allOf:
-      - $ref: /schemas/types.yaml#definitions/uint32-array
-      - minItems: 1
-        maxItems: 6
-        uniqueItems: true
-        items:
-          minimum: 2
-          maximum: 7
+    $ref: /schemas/types.yaml#definitions/uint32-array
+    minItems: 1
+    maxItems: 6
+    uniqueItems: true
+    items:
+      minimum: 2
+      maximum: 7
 
   mti,reserved-ipi-vectors:
     description: |
@@ -57,13 +56,12 @@ properties:
       It accepts two values: the 1st is the starting interrupt and the 2nd is
       the size of the reserved range. If not specified, the driver will
       allocate the last (2 * number of VPEs in the system).
-    allOf:
-      - $ref: /schemas/types.yaml#definitions/uint32-array
-      - items:
-          - minimum: 0
-            maximum: 254
-          - minimum: 2
-            maximum: 254
+    $ref: /schemas/types.yaml#definitions/uint32-array
+    items:
+      - minimum: 0
+        maximum: 254
+      - minimum: 2
+        maximum: 254
 
   timer:
     type: object
Documentation/devicetree/bindings/media/i2c/dongwoon,dw9768.yaml +20 -23

59 lines not on this page · raw message

Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml +1 -2
index cfe25cface21..b3c3d0c3c390 100644
@@ -31,8 +31,7 @@ properties:
   ti,syscon-pcie-ctrl:
     description: Phandle to the SYSCON entry required for configuring PCIe mode
                  and link speed.
-    allOf:
-      - $ref: /schemas/types.yaml#/definitions/phandle
+    $ref: /schemas/types.yaml#/definitions/phandle
 
   power-domains:
     maxItems: 1
Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml +1 -2
index d7b60487c6c3..8200ba00bc09 100644
@@ -31,8 +31,7 @@ properties:
   ti,syscon-pcie-ctrl:
     description: Phandle to the SYSCON entry required for configuring PCIe mode
       and link speed.
-    allOf:
-      - $ref: /schemas/types.yaml#/definitions/phandle
+    $ref: /schemas/types.yaml#/definitions/phandle
 
   power-domains:
     maxItems: 1
Documentation/devicetree/bindings/sound/maxim,max98390.yaml +2 -4
index 9c2e3effa0c0..fea9a1b6619a 100644
@@ -18,16 +18,14 @@ properties:
     description: I2C address of the device.
 
   maxim,temperature_calib:
-    allOf:
-      - $ref: /schemas/types.yaml#/definitions/uint32
     description: The calculated temperature data was measured while doing the calibration.
+    $ref: /schemas/types.yaml#/definitions/uint32
     minimum: 0
     maximum: 65535
 
   maxim,r0_calib:
-    allOf:
-      - $ref: /schemas/types.yaml#/definitions/uint32
     description: This is r0 calibration data which was measured in factory mode.
+    $ref: /schemas/types.yaml#/definitions/uint32
     minimum: 1
     maximum: 8388607
 
Documentation/devicetree/bindings/sound/nvidia,tegra186-dspk.yaml +1 -2
index e620c77d0728..2f2fcffa65cb 100644
@@ -48,8 +48,7 @@ properties:
 
   sound-name-prefix:
     pattern: "^DSPK[1-9]$"
-    allOf:
-      - $ref: /schemas/types.yaml#/definitions/string
+    $ref: /schemas/types.yaml#/definitions/string
     description:
       Used as prefix for sink/source names of the component. Must be a
       unique string among multiple instances of the same component.
Documentation/devicetree/bindings/sound/nvidia,tegra210-dmic.yaml +1 -2
index 1c14e83f67c7..8689d9f18c11 100644
@@ -49,8 +49,7 @@ properties:
 
   sound-name-prefix:
     pattern: "^DMIC[1-9]$"
-    allOf:
-      - $ref: /schemas/types.yaml#/definitions/string
+    $ref: /schemas/types.yaml#/definitions/string
     description:
       used as prefix for sink/source names of the component. Must be a
       unique string among multiple instances of the same component.
Documentation/devicetree/bindings/sound/nvidia,tegra210-i2s.yaml +1 -2
index 795797001843..9bbf18153d63 100644
@@ -67,8 +67,7 @@ properties:
 
   sound-name-prefix:
     pattern: "^I2S[1-9]$"
-    allOf:
-      - $ref: /schemas/types.yaml#/definitions/string
+    $ref: /schemas/types.yaml#/definitions/string
     description:
       Used as prefix for sink/source names of the component. Must be a
       unique string among multiple instances of the same component.
Documentation/devicetree/bindings/sound/ti,j721e-cpb-audio.yaml +2 -4
index 6f2be6503401..d52cfbeb2d07 100644
@@ -37,13 +37,11 @@ properties:
 
   ti,cpb-mcasp:
     description: phandle to McASP used on CPB
-    allOf:
-      - $ref: /schemas/types.yaml#/definitions/phandle
+    $ref: /schemas/types.yaml#/definitions/phandle
 
   ti,cpb-codec:
     description: phandle to the pcm3168a codec used on the CPB
-    allOf:
-      - $ref: /schemas/types.yaml#/definitions/phandle
+    $ref: /schemas/types.yaml#/definitions/phandle
 
   clocks:
     items:
Documentation/devicetree/bindings/sound/ti,j721e-cpb-ivi-audio.yaml +5 -10
index e0b88470a502..bb780f621628 100644
@@ -50,28 +50,23 @@ properties:
 
   ti,cpb-mcasp:
     description: phandle to McASP used on CPB
-    allOf:
-      - $ref: /schemas/types.yaml#/definitions/phandle
+    $ref: /schemas/types.yaml#/definitions/phandle
 
   ti,cpb-codec:
     description: phandle to the pcm3168a codec used on the CPB
-    allOf:
-      - $ref: /schemas/types.yaml#/definitions/phandle
+    $ref: /schemas/types.yaml#/definitions/phandle
 
   ti,ivi-mcasp:
     description: phandle to McASP used on IVI
-    allOf:
-      - $ref: /schemas/types.yaml#/definitions/phandle
+    $ref: /schemas/types.yaml#/definitions/phandle
 
   ti,ivi-codec-a:
     description: phandle to the pcm3168a-A codec on the expansion board
-    allOf:
-      - $ref: /schemas/types.yaml#/definitions/phandle
+    $ref: /schemas/types.yaml#/definitions/phandle
 
   ti,ivi-codec-b:
     description: phandle to the pcm3168a-B codec on the expansion board
-    allOf:
-      - $ref: /schemas/types.yaml#/definitions/phandle
+    $ref: /schemas/types.yaml#/definitions/phandle
 
   clocks:
     items:
Signature · 1 line
2.25.1