Skip to content

Commit 207775f

Browse files
Rafał Miłeckigregkh
authored andcommitted
nvmem: brcm_nvram: find Device Tree nodes for NVMEM cells
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 <rafal@milecki.pl> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20220429162701.2222-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent dbc2f62 commit 207775f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/nvmem/brcm_nvram.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/module.h>
99
#include <linux/nvmem-consumer.h>
1010
#include <linux/nvmem-provider.h>
11+
#include <linux/of.h>
1112
#include <linux/platform_device.h>
1213
#include <linux/slab.h>
1314

@@ -72,6 +73,7 @@ static int brcm_nvram_add_cells(struct brcm_nvram *priv, uint8_t *data,
7273
return -ENOMEM;
7374
priv->cells[idx].offset = value - (char *)data;
7475
priv->cells[idx].bytes = strlen(value);
76+
priv->cells[idx].np = of_get_child_by_name(dev->of_node, priv->cells[idx].name);
7577
}
7678

7779
return 0;

0 commit comments

Comments
 (0)