[PATCH v2 3/4] docs: dt: writing-bindings: Document discouraged instance IDs

Krzysztof Kozlowski posted 4 patches 2 months, 3 weeks ago
[PATCH v2 3/4] docs: dt: writing-bindings: Document discouraged instance IDs
Posted by Krzysztof Kozlowski 2 months, 3 weeks ago
Document established Devicetree bindings maintainers review practice:
instance indexes, either as properties or as custom new OF alias, are
not accepted.  Recommended way is to use, depending on the
situation/hardware: different compatible, cell arguments or syscon
phandle arguments.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Changes in v2:
1. New patch
---
 Documentation/devicetree/bindings/writing-bindings.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/writing-bindings.rst b/Documentation/devicetree/bindings/writing-bindings.rst
index e63de88385b5bc5859d8d9fca82bcf30380f3e73..f8e0293a7c0621a343a493d448624bff916ba021 100644
--- a/Documentation/devicetree/bindings/writing-bindings.rst
+++ b/Documentation/devicetree/bindings/writing-bindings.rst
@@ -105,6 +105,11 @@ Typical cases and caveats
 - "syscon" is not a generic property. Use vendor and type, e.g.
   "vendor,power-manager-syscon".
 
+- Do not add instance index (IDs) properties or custom OF aliases.  If the
+  devices have different programming model, they might need different
+  compatibles.  If such devices use some other device in a different way, e.g.
+  they program the phy differently, use cell/phandle arguments.
+
 - Bindings files should be named like compatible: vendor,device.yaml. In case
   of multiple compatibles in the binding, use one of the fallbacks or a more
   generic name, yet still matching compatible style.

-- 
2.43.0
Re: [PATCH v2 3/4] docs: dt: writing-bindings: Document discouraged instance IDs
Posted by Rob Herring (Arm) 2 months, 3 weeks ago
On Sun, 13 Jul 2025 14:46:38 +0200, Krzysztof Kozlowski wrote:
> Document established Devicetree bindings maintainers review practice:
> instance indexes, either as properties or as custom new OF alias, are
> not accepted.  Recommended way is to use, depending on the
> situation/hardware: different compatible, cell arguments or syscon
> phandle arguments.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> ---
> 
> Changes in v2:
> 1. New patch
> ---
>  Documentation/devicetree/bindings/writing-bindings.rst | 5 +++++
>  1 file changed, 5 insertions(+)
> 

Applied, thanks!
Re: [PATCH v2 3/4] docs: dt: writing-bindings: Document discouraged instance IDs
Posted by Conor Dooley 2 months, 3 weeks ago
On Sun, Jul 13, 2025 at 02:46:38PM +0200, Krzysztof Kozlowski wrote:
> Document established Devicetree bindings maintainers review practice:
> instance indexes, either as properties or as custom new OF alias, are
> not accepted.  Recommended way is to use, depending on the
> situation/hardware: different compatible, cell arguments or syscon
> phandle arguments.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>