mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/2] nvmem: add support for fixed-layout binding
Date: Wed,  3 Jul 2024 21:09:36 +0200	[thread overview]
Message-ID: <20240703190937.689547-1-a.fatoum@pengutronix.de> (raw)

At long last, nvmem cells as direct subnodes of the provider has been
deprecated and replaced by a layout binding that allows a NVMEM provider
to do arbitrary processing of cells before exposing them to the
framework.

We'll want to support the layout binding eventually, but for now, let's
just add the trivial modifications necessary to support the
fixed-layout, which is just a compatible = "fixed-layout" node
that contains the individual cells.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/nvmem/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index bf393fc180ab..67276cf3b57b 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -400,6 +400,8 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
 		return ERR_PTR(-EINVAL);
 
 	nvmem_np = of_get_parent(cell_np);
+	if (nvmem_np && of_device_is_compatible(nvmem_np, "fixed-layout"))
+		nvmem_np = of_get_parent(nvmem_np);
 	if (!nvmem_np)
 		return ERR_PTR(-EINVAL);
 
-- 
2.39.2




             reply	other threads:[~2024-07-03 19:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-03 19:09 Ahmad Fatoum [this message]
2024-07-03 19:09 ` [PATCH 2/2] sandbox: use " Ahmad Fatoum
2024-07-15  9:05 ` [PATCH 1/2] nvmem: add support for " Sascha Hauer

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=20240703190937.689547-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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