aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafał Miłecki <[email protected]>2022-09-16 13:20:57 +0100
committerGreg Kroah-Hartman <[email protected]>2022-09-24 14:54:38 +0200
commitd4d432670f7dee0a5432fcffcfc8699b25181ace (patch)
tree8edb59b3791c06daf8dae96658ff6e41cc56c17c
parent8f6a3a19e99cdb52b0ff0d2d3197e810258b6e46 (diff)
nvmem: u-boot-env: find Device Tree nodes for NVMEM cells
DT binding allows specifying NVMEM cells as NVMEM device (provider) subnodes. Looks for such subnodes when building NVMEM cells. This allows NVMEM consumers to use U-Boot environment variables. Signed-off-by: Rafał Miłecki <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/nvmem/u-boot-env.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvmem/u-boot-env.c b/drivers/nvmem/u-boot-env.c
index 9b9abfb8f187..d17a164ae705 100644
--- a/drivers/nvmem/u-boot-env.c
+++ b/drivers/nvmem/u-boot-env.c
@@ -92,6 +92,7 @@ static int u_boot_env_add_cells(struct u_boot_env *priv, uint8_t *buf,
return -ENOMEM;
priv->cells[idx].offset = data_offset + value - data;
priv->cells[idx].bytes = strlen(value);
+ priv->cells[idx].np = of_get_child_by_name(dev->of_node, priv->cells[idx].name);
}
if (WARN_ON(idx != priv->ncells))