[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdU8q0VUxw-EXDqjjYbjeCwCkKuDJUjO0vSaCVrYLXqX4A@mail.gmail.com>
Date: Mon, 23 Apr 2018 18:49:59 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Grant Likely <grant.likely@....com>
Cc: Rob Herring <robh@...nel.org>,
Frank Rowand <frowand.list@...il.com>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>, devicetree-spec@...r.kernel.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Mark Rutland <mark.rutland@....com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Linus Walleij <linus.walleij@...aro.org>,
Thierry Reding <thierry.reding@...il.com>,
Mark Brown <broonie@...nel.org>,
Shawn Guo <shawnguo@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Arnd Bergmann <arnd@...db.de>, Stephen Boyd <sboyd@...nel.org>,
Jonathan Cameron <jic23@...nel.org>
Subject: Re: [RFC PATCH] dt-bindings: add a jsonschema binding example
Hi Grant,
On Mon, Apr 23, 2018 at 4:47 PM, Grant Likely <grant.likely@....com> wrote:
> On 21/04/2018 02:28, Rob Herring wrote:
>> On Fri, Apr 20, 2018 at 4:00 PM, Frank Rowand <frowand.list@...il.com>
>> wrote:
>>>> + interrupts:
>>>> + # Either 1 or 2 interrupts can be present
>>>> + minItems: 1
>>>> + maxItems: 2
>>>> + items:
>>>> + - description: tx or combined interrupt
>>>> + - description: rx interrupt
>>>> +
>>>> + description: |
>>>> + A variable number of interrupts warrants a description of what
>>>> conditions
>>>> + affect the number of interrupts. Otherwise, descriptions on
>>>> standard
>>>> + properties are not necessary.
>>>> +
>>>> + interrupt-names:
>>>> + # minItems must be specified here because the default would be 2
>>>> + minItems: 1
>>>
>>> Why the difference between the interrupts property and the
>>> interrupt-names
>>> property (specifying maxItems for interrupt, but not interrupt-names)?
>>
>> I should probably have maxItems here too.
>>
>>> Others have already commented on a desire to have a way to specify that
>>> number of interrupts should match number of interrupt-names.
>>
>> Yeah, but I don't see a way to do that. You could stick the array size
>> constraints in a common definition and have a $ref to that definition
>> from both, but that doesn't really save you too much.
>
>
> There has been discussions in the jsonschema community regarding
> referencing data in the document when applying the schema.
>
> https://github.com/json-schema-org/json-schema-spec/issues/549
>
> However, those discussions are ongoing and have been pushed back to
> after draft-8 (the current release is draft-7). We can instead define
> DT-specific keywords and extend the validator to make it do what we
> want. We need to do something very similar to validate that the length
> of tuples in 'reg', 'interrupts', and '*gpios' match the '#*-cells' values.
Checking that property lengths match the corresponding #*-cells cannot
be done for a schema, but only for the final DTS, as #*-cells is a property
of the target node, right?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists