mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] nvmem: add support for fixed-layout binding
@ 2024-07-03 19:09 Ahmad Fatoum
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2024-07-03 19:09 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-07-15  9:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-03 19:09 [PATCH 1/2] nvmem: add support for fixed-layout binding Ahmad Fatoum
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox