Re: [PATCH] meta-schemas: interrupts: allow interrupt-controller nodes to be objects

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



On Tue, Jun 11, 2019 at 3:16 AM Maxime Ripard <maxime.ripard@xxxxxxxxxxx> wrote:
>
> Hi,
>
> On Mon, Jun 10, 2019 at 03:54:10PM -0600, Rob Herring wrote:
> > On Wed, May 15, 2019 at 11:19 AM Paul Walmsley <paul.walmsley@xxxxxxxxxx> wrote:
> > >
> > > RISC-V cores contain basic interrupt controllers, described in
> > > DT 'cpus' data in the form:
> > >
> > >         cpu@0 {
> > >                 [... other CPU properties ...]
> > >                 interrupt-controller {
> > >                         #interrupt-cells = <1>;
> > >                         compatible = "riscv,cpu-intc";
> > >                         interrupt-controller;
> > >                 };
> > >         };
> > >
> > > Since the existing interrupts meta-schema requires the type of the
> > > "interrupt-controller" node to be a boolean, it doesn't support this
> > > usage.  Support this by relaxing the type constraint on
> > > "interrupt-controller" nodes to also accept objects.  Since this usage
> > > does not require an "#interrupt-cells" node at the same tree depth as
> > > the "interrupt-controller" object, remove the dependency accordingly.
> > >
> > > Signed-off-by: Paul Walmsley <paul.walmsley@xxxxxxxxxx>
> > > Cc: Rob Herring <robh@xxxxxxxxxx>
> > > ---
> > >  meta-schemas/interrupts.yaml | 5 +++--
> > >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > Applied, thanks.
>
> It looks like it breaks the tests though:
> https://travis-ci.org/devicetree-org/dt-schema/builds/543946648

Indeed. I fixed it like this:

diff --git a/meta-schemas/interrupts.yaml b/meta-schemas/interrupts.yaml
index 8130025e412a..7073063486d4 100644
--- a/meta-schemas/interrupts.yaml
+++ b/meta-schemas/interrupts.yaml
@@ -20,7 +20,7 @@ properties:
   interrupt-controller:
     oneOf:
       - $ref: "boolean.yaml"
-      - type: object
+      - $ref: "nodes.yaml"
   interrupt-parent: false # interrupt-parent is implicit

 dependencies:
diff --git a/meta-schemas/nodes.yaml b/meta-schemas/nodes.yaml
new file mode 100644
index 000000000000..4a379b2d87c8
--- /dev/null
+++ b/meta-schemas/nodes.yaml
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: BSD-2-Clause
+# Copyright 2019 Arm Ltd.
+%YAML 1.2
+---
+$id: "http://devicetree.org/meta-schemas/nodes.yaml#";
+$schema: "http://json-schema.org/draft-07/schema#";
+
+properties:
+  type:
+    const: object
+  description: {}
+  properties: {}
+
+required:
+  - type
+  - properties
+
+additionalProperties: false



[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