[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVvAN9YcS4XsyinC1+WfAt0YwdNjv_pCpnfBpmGFeXtRg@mail.gmail.com>
Date: Thu, 16 Nov 2023 22:32:17 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Arnd Bergmann <arnd@...db.de>,
Bjorn Andersson <andersson@...nel.org>,
Heiko Stuebner <heiko@...ech.de>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Michal Simek <michal.simek@....com>,
Neil Armstrong <neil.armstrong@...aro.org>,
Nishanth Menon <nm@...com>, Olof Johansson <olof@...om.net>
Subject: Re: [PATCH] docs: dt-bindings: add DTS Coding Style document
Hi Krzysztof,
On Thu, Nov 16, 2023 at 7:12 PM Krzysztof Kozlowski
<krzysztof.kozlowski@...aro.org> wrote>
> Document preferred coding style for Devicetree sources (DTS and DTSI),
> to bring consistency among all (sub)architectures and ease in reviews.
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Thanks for your patch!
> --- a/Documentation/devicetree/bindings/index.rst
> +++ b/Documentation/devicetree/bindings/index.rst
> +Order of Nodes
> +--------------
> +
> +1. Nodes within any bus, thus using unit addresses for children, shall be
> + ordered incrementally by unit address.
In Renesas DTS files, we have an (unwritten) additional rule: when there
are multiple nodes of the same type, they do not follow the global
ordering by unit-address, but are grouped together.
E.g. the second and any subsequent serial ports are always listed
immediately after the first serial port.
> +2. Nodes without unit addresses should be ordered alpha-numerically.
> +
> +3. When extending nodes in board DTS via &label, the entries should be ordered
> + alpha-numerically.
> +Order of Properties in Device Node
> +----------------------------------
> +
> +Following order of properties in device nodes is preferred:
> +
> +1. compatible
> +2. reg
> +3. ranges
> +4. All properties with values
> +5. Boolean properties
> +6. status (if applicable)
There must be a lank line between properties and child nodes?
And once we have a documented coding style, the next long-standing item
from our wishlist would be a script to sort the contents of a DTS file
according to the rules ;-)
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