[PATCH 1/2] nvmem: add support for fixed-layout binding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux