devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: kernel@pengutronix.de, ceggers@arri.de,
	Ahmad Fatoum <a.fatoum@pengutronix.de>,
	Rob Herring <robh+dt@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 1/2] dt-bindings: nvmem: skip nodes with compatibles other than "nvmem-cell"
Date: Tue, 28 Apr 2020 13:18:26 +0200	[thread overview]
Message-ID: <20200428111829.2215-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20200428111829.2215-1-a.fatoum@pengutronix.de>

For nodes matching the nvmem binding, all child objects matching
"^.*@[0-9a-f]+$" are assumed to be nvmem cells, without taking a
compatible into account.

This precludes:

  - future extension of e.g. eeprom nodes by any child nodes other
    than nvmem cells
  - extending the NVMEM binding to nodes that already have other
    child nodes, e.g., MTD and its partitions

To allow co-existence of nvmem-cells with other nodes, loosen the
binding to consult an optional compatible property for the cells:

  - if a compatible exists, it must be "nvmem-cell"
  - if none exists, it's assumed to be a nvmem cell, like before

As additionalProperties: false was specified for nvmem-cell bindings,
a compatible property was so far invalid. This means no already
compliant device tree should be reinterpreted differently after
this binding adjustment and in that regard, the change is completely
backwards-compatible.

This resolves an existing clash between this nvmem-cell binding and
the barebox bootloader binding that extends the fixed-partitions MTD
binding to EEPROMs.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 Documentation/devicetree/bindings/nvmem/nvmem.yaml | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/nvmem/nvmem.yaml b/Documentation/devicetree/bindings/nvmem/nvmem.yaml
index 65980224d550..c39f5dd7e1aa 100644
--- a/Documentation/devicetree/bindings/nvmem/nvmem.yaml
+++ b/Documentation/devicetree/bindings/nvmem/nvmem.yaml
@@ -44,9 +44,21 @@ properties:
 
 patternProperties:
   "^.*@[0-9a-f]+$":
-    type: object
+    if:
+      properties:
+        compatible:
+          items:
+            const: nvmem-cell
+    then:
+      $ref: "#/definitions/nvmem-cell"
 
+definitions:
+  nvmem-cell:
     properties:
+      compatible:
+          items:
+            const: nvmem-cell
+
       reg:
         maxItems: 1
         description:
-- 
2.26.2


  reply	other threads:[~2020-04-28 11:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 11:18 [PATCH v3 0/2] nvmem: skip nodes with compatibles other than "nvmem-cell" Ahmad Fatoum
2020-04-28 11:18 ` Ahmad Fatoum [this message]
2020-05-08  6:56   ` [PATCH v3 1/2] dt-bindings: " Ahmad Fatoum
2020-05-12 14:18 ` [PATCH v3 0/2] " Rob Herring
2020-10-12 15:36   ` Ahmad Fatoum
2020-11-02 15:23     ` Ahmad Fatoum
2020-11-16 17:04       ` Ahmad Fatoum
2020-11-16 17:21         ` Srinivas Kandagatla
2020-11-16 17:28           ` Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200428111829.2215-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=ceggers@arri.de \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).