Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2527654ybv; Mon, 24 Feb 2020 06:52:38 -0800 (PST) X-Google-Smtp-Source: APXvYqw64/IkpZnqwD+mlGcM8ie/83JA/un1FTaQtMXn+ErjuFJPy9OFl/YYAIuT+usoz/Rzg34D X-Received: by 2002:a54:4e96:: with SMTP id c22mr13282385oiy.110.1582555957994; Mon, 24 Feb 2020 06:52:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582555957; cv=none; d=google.com; s=arc-20160816; b=M+Qlyoi19wzFZ84JG7lkBvulAdXz54CWIEZ7YXQfCgT1Kse8q9wwvUCk6afVzxRUr4 WPs1aWWP3IHY7GLIwO2iRBup3Pf6mp+SmWUfAdcg7pq6vlO5eQNSCyK4voKMfVzag1Gp 6hMz61EvgNrIkXbx53M5hZcuQPBjX3Q5C7dvahFuhY52J6QkieAWxP5XJFXuiH2qajVh OJHQYI77ukPzHSQip3y7Fpe8KF3e57VTeLo494iS9tbKj1PUsUaIglM/WbDcWqUN/3is MEtDcuO8i2bp9tKzWKeDZgi/UwpX5Gy5xoi3RyZVmQRhE0u63tdRyLs1cO2mH1YnBbNz 5PwA== 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 :in-reply-to:references:mime-version:dkim-signature; bh=QN7qIqNRBBuDCKb0dy2Br3kVrAKmlaoE8A5wVRg6OEI=; b=fYRLolREGcvBYtLPKyFz26VaYDg98jpdi7CuDVbPAGlZLMdILkvKuOpK6vStnaFZ61 isVDd/uwznrSgJCNA1H2jNwIMF6gL1/kkt0Wi9qPHw2+YGTzREtbwrTizU/IWgZuK9lK nSNBbgLlfJqUVonUg67KgG4sCjIIUvntypSAJO/cL68FnIseFaRd3S+Coom2qdDU+YEx 2wHrvYHzK4vsGT/EfgTVhowJuvQuFQwjQt4a0LlFE1n6O2yZPr2/J2zA0Rw04nwOVeOa QRzxRVVHPnqjumZ1HxWFnEiTQfDX/7b+GwZPkDmxSop9qhXetnjUV3YxftdFN6e4fEoU ANzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=emz3wz7R; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m7si6596990otk.73.2020.02.24.06.52.25; Mon, 24 Feb 2020 06:52:37 -0800 (PST) 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=pass header.i=@kernel.org header.s=default header.b=emz3wz7R; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727670AbgBXOwF (ORCPT + 99 others); Mon, 24 Feb 2020 09:52:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:59604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727474AbgBXOwF (ORCPT ); Mon, 24 Feb 2020 09:52:05 -0500 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DACFC20836; Mon, 24 Feb 2020 14:52:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582555924; bh=XRi0OmHVHDee1GTej+sJ5OKiNNLB45ifwcR2vnGTriE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=emz3wz7Ro5hhDbUK45uRjE/GOzzpc3xgdSqBISPZkQrYw3cmsSjhpNfSPlXBLnwdE kcewki6VbecIyeDD3mBAJWecySt85yvGUT+/ld/07q6kFoFqVchCtenkjF8QsZxBSo HHcfEWbBHf1CqUCwoNQSK5oHdp8sVjA8IRaRgBf4= Received: by mail-qk1-f177.google.com with SMTP id h4so8919657qkm.0; Mon, 24 Feb 2020 06:52:03 -0800 (PST) X-Gm-Message-State: APjAAAXE3OthYOmae/owoRfw3P1tJqWVVQXkFPS+db0d25c683XV4neZ CwHea0iQpNgBUGgxg6qYZB1eCYskZVBEc4LaYQ== X-Received: by 2002:ae9:f205:: with SMTP id m5mr50756836qkg.152.1582555922990; Mon, 24 Feb 2020 06:52:02 -0800 (PST) MIME-Version: 1.0 References: <20200221021002.18795-1-yamada.masahiro@socionext.com> <20200221021002.18795-2-yamada.masahiro@socionext.com> <20200221153215.GA9815@bogus> In-Reply-To: From: Rob Herring Date: Mon, 24 Feb 2020 08:51:50 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/3] dt-bindings: gpio: Convert UniPhier GPIO to json-schema To: Masahiro Yamada Cc: DTML , Frank Rowand , Bartosz Golaszewski , "David S. Miller" , Greg Kroah-Hartman , Jonathan Cameron , Linus Walleij , Mark Rutland , Mauro Carvalho Chehab , linux-arm-kernel , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List 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 On Fri, Feb 21, 2020 at 11:33 PM Masahiro Yamada wrote: > > Hi Rob, > > On Sat, Feb 22, 2020 at 12:32 AM Rob Herring wrote: > > > > On Fri, 21 Feb 2020 11:10:01 +0900, Masahiro Yamada wrote: > > > Convert the UniPhier GPIO controller binding to DT schema format. > > > > > > I omitted the 'gpio-ranges' property because it is defined in the > > > dt-schema project (/schemas/gpio/gpio.yaml). > > > > > > As of writing, the 'gpio-ranges-group-names' is not defined in that > > > file despite it is a common property described in > > > Documentation/devicetree/bindings/gpio/gpio.txt > > > So, I defined it in this schema. > > > > > > Signed-off-by: Masahiro Yamada > > > --- > > > > > > I have a question about the range about 'ngpio'. > > > > > > ngpios: > > > minimum: 0 > > > maximum: 512 > > > > > > The 'ngpio' property is already defined as 'uint32' in the dt-schema tool: > > > https://github.com/robherring/dt-schema/blob/master/schemas/gpio/gpio.yaml#L20 > > > > > > 'uint32' is unsigned, so 'minimum: 0' looks too obvious. > > > > > > I cannot omit the minimum because minimum and maximum depend on each other. > > > I just put a sensible number, 512, in maximum. > > > > > > If this range is entirely unneeded, I will delete it. > > > > This property is generally for when you can have some number less > > than a maximum number implied by the compatible string. > > > > If there is really no max (e.g. 2^32 - 1 is valid), then just do > > 'ngpios: true' > > > What does ': true' mean? It's a schema that always passes validation. It's purpose here is just to say you are using this common property for this binding. > > If it is documented somewhere, > could you point me to the reference? https://github.com/devicetree-org/dt-schema/blob/master/schemas/gpio/gpio.yaml > > Even if I remove the 'ngpio' entirely > from my dt-schema, the 'ngpio' is checked > correctly. Yes, if you change it to a string value for example, it should fail. (Only if DT_SCHEMA_FILES is not set without my kbuild changes) You should also add 'additionalProperties: false' at the top level of your schema and then it will also fail if you don't list ngpios in properties. Rob