lkml.org 
[lkml]   [2023]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] docs: dt-bindings: add DTS Coding Style document
From
On 16.11.2023 19:12, Krzysztof Kozlowski wrote:
> Document preferred coding style for Devicetree sources (DTS and DTSI),
> to bring consistency among all (sub)architectures and ease in reviews.
>
> Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Bjorn Andersson <andersson@kernel.org>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: Konrad Dybcio <konrad.dybcio@linaro.org>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> Cc: Michal Simek <michal.simek@amd.com>
> Cc: Neil Armstrong <neil.armstrong@linaro.org>
> Cc: Nishanth Menon <nm@ti.com>
> Cc: Olof Johansson <olof@lixom.net>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>
> ---
[...]

> +Order of Nodes
> +--------------
> +
> +1. Nodes within any bus, thus using unit addresses for children, shall be
> + ordered incrementally by unit address.
> +
> +2. Nodes without unit addresses should be ordered alpha-numerically.
I largely agree with all this given our fight for some level of
tidyness across linux-msm, but there's one specific case where I think
it would make sense to break this ordering, and that's GPIO states:


&pinctrl {
xyz-active-state {
pins ="gpio0";
...
};

abc-active-state {
pins ="gpio1";
...
};

qwe-active-state {
pins ="gpio2";
...
};
};

looks so much more readable to me than

&pinctrl {
abc-active-state {
pins ="gpio1";
...
};

qwe-active-state {
pins ="gpio2";
...
};

xyz-active-state {
pins ="gpio0";
...
};
};

Konrad

\
 
 \ /
  Last update: 2023-11-20 14:04    [W:0.287 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site