From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rob Herring Subject: Re: [PATCH v2 1/2] dt-bindings: mtd: Add YAML schemas for the generic NAND options Date: Thu, 11 Apr 2019 08:19:32 -0500 Message-ID: References: <74b8a52ce98b09d7906f988c107793a86c0c5f6b.1554216856.git-series.maxime.ripard@bootlin.com> <20190403073551.ym7nbqwcdpicwo6e@flea> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190403073551.ym7nbqwcdpicwo6e@flea> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Maxime Ripard Cc: Mark Rutland , devicetree@vger.kernel.org, Chen-Yu Tsai , Boris Brezillon , MTD Maling List , Miquel Raynal , Frank Rowand , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" List-Id: devicetree@vger.kernel.org On Wed, Apr 3, 2019 at 2:35 AM Maxime Ripard wrote: > > Hi Rob, > > On Tue, Apr 02, 2019 at 08:20:58PM -0500, Rob Herring wrote: > > > + nand-ecc-strength: > > > + $ref: /schemas/types.yaml#/definitions/uint32 > > > + minimum: 1 > > > > While I wished this worked, these 2 have to be under 'allOf'. > > Unfortunately, this will also silently pass validation in json-schema. > > Unfortunately, I'm not sure I fully get how the ref system is supposed > to work yet. Can you elaborate a bit on why we should put the ref and > whatever constraint we have in an allOf? TL;DR is that is how sub-classing or extending schemas works. I think I read something at one point which explained why it doesn't work without allOf, but couldn't find it. Certainly, it seems like it should at first. > Should we do the same in a separate schema that would reference > another entire schema (like the second patch does with the first > one)? That would just split defining the type from the additional constraints. I prefer to keep the top-level 'allOf' including classes of devices. Rob