Received: by 10.192.165.148 with SMTP id m20csp3643532imm; Mon, 23 Apr 2018 09:52:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpC724Q6/94LSwjLAijVhV4OY4VAph6Ti9AzAJ6uqrIjg4KtmNjXjGFp8WIcKYC56aN9m4/ X-Received: by 10.98.206.78 with SMTP id y75mr929875pfg.175.1524502356136; Mon, 23 Apr 2018 09:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524502356; cv=none; d=google.com; s=arc-20160816; b=YNLmsjLT2NTgOkb6qT+snEeuGl0IsWjmsCAsdBTmOD7/e+wLp0XE2KZ/TkNBfAhCQu IrIcYuk2m5hsKRay+MQvWlqMFMXNS88mk7qXyeP2yVeKrEYpxXY5QCNztnTrejYBlCY3 uC5fbbPcGEmX8OIPQh2K5QZ+OMw3Ji88eHkYS1wjUo3y7BYrrOSckL/Wg5ynSkaI1mVk C2IaND+55Dre4wkvHknjpMd56qUKXPR4rBxGZYcKB+ZX9VIbz4NAr1/GLRQi7r1ItObS kIZDmOjp3OvlWWDCc8br0z54n+tUUuOmFJFQNDDyWQxFEx9w/Q3Z25Vsbaorqj1wSOVo pMjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=NhA6ZOGhT7JCXlaIi1e41SORkkocpsVIfMcmBZ3TFQE=; b=IWaoGpwsQszeGak6edc0lRytYi8MwhwJQ7sn/dRh3MEXRhX1nzyxTeU+HdQngHdZ2v kDKRi7w4JAqNy3CXt/LE1YFFm6idH/r6RVFw006SBY+nuE2yIFvN/7nWWWTotPwOBubd 1ZWcjFrKL0mxfsZPz6vg7k5103KRosDOA+SYCPH9ZPf5Wx7lPhctgUqI5oEhedUZtwt3 GTa35ymwZQeuNvd0dlSA8cpAc9g6qFsyvgFHU2GRTYfDw21y6K1vEWCmNbpFzyYpJtfO 2Vx3tcqOP3iHEaSBceraWTSpqnklCKObeOh5rteXQHBgrteRJ/HnujaMYqtvX4khyc+l +yiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=SmH/Qh+Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31-v6si12216513plz.364.2018.04.23.09.52.21; Mon, 23 Apr 2018 09:52:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=SmH/Qh+Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755749AbeDWQuD (ORCPT + 99 others); Mon, 23 Apr 2018 12:50:03 -0400 Received: from mail-ua0-f180.google.com ([209.85.217.180]:33733 "EHLO mail-ua0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755573AbeDWQuB (ORCPT ); Mon, 23 Apr 2018 12:50:01 -0400 Received: by mail-ua0-f180.google.com with SMTP id q26so10670052uab.0; Mon, 23 Apr 2018 09:50:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=NhA6ZOGhT7JCXlaIi1e41SORkkocpsVIfMcmBZ3TFQE=; b=SmH/Qh+YLRKYDpsbD4fdmAhNfHcSHh+Wp+8I9c8t4pdY6UXI/dffnRMkJkBsa1xiYs vMxBOFX2e/+6dJKng2R40VxD8dwnCOJa1jP9WfCN7EP/mkGrAvfntvyVn5U3PBNKV/0R gsis7Q6e7EwMdEa0kK56MKHb/C1/lo02aSc9O1YsK1wOubCk7kBn+dnEbeDzFlOp4ozM i31uKSpeENXnEdkWXX8i7fxiQ/aRhNc1Ey+05+F8q1S1gh0KI/WKmW7j6d5kc6ULC1S0 CkFq0oi5Bm5+NlIw0C+kiBMkZsAf+ny8sZMCkfBLIRlbFc+IoMXIBbLk/Wrv3VtXiBXY keog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=NhA6ZOGhT7JCXlaIi1e41SORkkocpsVIfMcmBZ3TFQE=; b=P8CNGyQ/2TBd1luAdB+2Z9z/+EhvPiHlqsqfFF2ZOoPYcxeeBtt95kK4ED5eBlbQJx kKtvWw8y8Ge/wK8HGBc49ZpcnmDlqyd3kRuD4TMnO2l4T/aH7dIA+pp7mz5k94Jv2JN6 wxUrJJ3xoktOWwmQ9TTQL7SCzWU0EWzEKdPsY4ic+zldkyz3Cmhj8b49jvKUgNlmD2vx qA3dZbvngvfLmodvLSYwFikszeJZ4vnDJyhDtiqQiCiu9JKP4TvKvZQaYOONEE5BJNh2 +pNoTGpXOu9llTITBszmWv8dZ59x4JNeXNnh599/gHm/6uoPSILj5f+0ojwLRvy56UAe l4vg== X-Gm-Message-State: ALQs6tCPF93L7PT0JImqXpRIea3j0dkN5a45uwlaFCVUkhIRSBFcbJ0g 0v+rOuRNM8FF4MT+Y6japnN5j4Ifr17hQDe/qco= X-Received: by 10.159.53.141 with SMTP id t13mr13960503uad.26.1524502200649; Mon, 23 Apr 2018 09:50:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.122.68 with HTTP; Mon, 23 Apr 2018 09:49:59 -0700 (PDT) In-Reply-To: References: <20180418222905.10414-1-robh@kernel.org> From: Geert Uytterhoeven Date: Mon, 23 Apr 2018 18:49:59 +0200 X-Google-Sender-Auth: BAaTojsyLgo6HiRq-slUpM72zyk Message-ID: Subject: Re: [RFC PATCH] dt-bindings: add a jsonschema binding example To: Grant Likely Cc: Rob Herring , Frank Rowand , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , devicetree-spec@vger.kernel.org, "linux-kernel@vger.kernel.org" , Mark Rutland , Geert Uytterhoeven , Linus Walleij , Thierry Reding , Mark Brown , Shawn Guo , Bjorn Andersson , Arnd Bergmann , Stephen Boyd , Jonathan Cameron Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Grant, On Mon, Apr 23, 2018 at 4:47 PM, Grant Likely wrote: > On 21/04/2018 02:28, Rob Herring wrote: >> On Fri, Apr 20, 2018 at 4:00 PM, Frank Rowand >> 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@linux-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