1234567891011121314151617181920212223242526272829303132333435363738 |
- From 207775f7e17b8fd0426a2ac4a5b81e4e1d71849e Mon Sep 17 00:00:00 2001
- From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
- 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 <[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]>
- ---
- 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 <linux/module.h>
- #include <linux/nvmem-consumer.h>
- #include <linux/nvmem-provider.h>
- +#include <linux/of.h>
- #include <linux/platform_device.h>
- #include <linux/slab.h>
-
- @@ -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;
|