From 207775f7e17b8fd0426a2ac4a5b81e4e1d71849e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 29 Apr 2022 17:26:47 +0100 Subject: [PATCH] nvmem: brcm_nvram: find Device Tree nodes for NVMEM cells MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DT binding for Broadcom's NVRAM supports specifying NVMEM cells as NVMEM device (provider) subnodes. Look for such subnodes when collecing NVMEM cells. This allows NVMEM consumers to use NVRAM variables. Signed-off-by: Rafał Miłecki Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220429162701.2222-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/nvmem/brcm_nvram.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/nvmem/brcm_nvram.c +++ b/drivers/nvmem/brcm_nvram.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -72,6 +73,7 @@ static int brcm_nvram_add_cells(struct b return -ENOMEM; priv->cells[idx].offset = value - (char *)data; priv->cells[idx].bytes = strlen(value); + priv->cells[idx].np = of_get_child_by_name(dev->of_node, priv->cells[idx].name); } return 0;