Re: [PATCH] dt-bindings: reserved-memory: Add restricted-dma-pool constraints

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 2022-02-17 16:05, Rob Herring wrote:
On Thu, Feb 17, 2022 at 7:10 AM Robin Murphy <robin.murphy@xxxxxxx> wrote:

The "restricted-dma-pool" definition prohibits combination with either
of the "no-map" and "reusable" properties, but this is only stated in
the description text. Add those constraints to the schema so we can
properly validate them.

Signed-off-by: Robin Murphy <robin.murphy@xxxxxxx>
---
  .../bindings/reserved-memory/shared-dma-pool.yaml   | 13 +++++++++++++
  1 file changed, 13 insertions(+)

diff --git a/Documentation/devicetree/bindings/reserved-memory/shared-dma-pool.yaml b/Documentation/devicetree/bindings/reserved-memory/shared-dma-pool.yaml
index a4bf757d6881..01385581f663 100644
--- a/Documentation/devicetree/bindings/reserved-memory/shared-dma-pool.yaml
+++ b/Documentation/devicetree/bindings/reserved-memory/shared-dma-pool.yaml
@@ -56,6 +56,19 @@ properties:
        If this property is present, then Linux will use the region for
        the default pool of the consistent DMA allocator.

+if:
+  properties:
+    compatible:
+      contains:
+        const: restricted-dma-pool
+then:
+  not:
+    anyOf:
+      - required:
+          - no-map
+      - required:
+          - reusable

I think it is a bit clearer to disallow properties like this:

then:
   properties:
     no-map: false
     reusable: false

Aha! I was sure there must be a better way, but couldn't see the wood for the trees, thanks!

Robin.



+
  unevaluatedProperties: false

  examples:
--
2.28.0.dirty




[Index of Archives]     [Device Tree]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Photos]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]

  Powered by Linux