805-v5.19-0005-nvmem-brcm_nvram-find-Device-Tree-nodes-for-NVMEM-ce.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From 207775f7e17b8fd0426a2ac4a5b81e4e1d71849e Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
  3. Date: Fri, 29 Apr 2022 17:26:47 +0100
  4. Subject: [PATCH] nvmem: brcm_nvram: find Device Tree nodes for NVMEM cells
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. DT binding for Broadcom's NVRAM supports specifying NVMEM cells as NVMEM
  9. device (provider) subnodes. Look for such subnodes when collecing NVMEM
  10. cells. This allows NVMEM consumers to use NVRAM variables.
  11. Signed-off-by: Rafał Miłecki <[email protected]>
  12. Signed-off-by: Srinivas Kandagatla <[email protected]>
  13. Link: https://lore.kernel.org/r/[email protected]
  14. Signed-off-by: Greg Kroah-Hartman <[email protected]>
  15. ---
  16. drivers/nvmem/brcm_nvram.c | 2 ++
  17. 1 file changed, 2 insertions(+)
  18. --- a/drivers/nvmem/brcm_nvram.c
  19. +++ b/drivers/nvmem/brcm_nvram.c
  20. @@ -8,6 +8,7 @@
  21. #include <linux/module.h>
  22. #include <linux/nvmem-consumer.h>
  23. #include <linux/nvmem-provider.h>
  24. +#include <linux/of.h>
  25. #include <linux/platform_device.h>
  26. #include <linux/slab.h>
  27. @@ -72,6 +73,7 @@ static int brcm_nvram_add_cells(struct b
  28. return -ENOMEM;
  29. priv->cells[idx].offset = value - (char *)data;
  30. priv->cells[idx].bytes = strlen(value);
  31. + priv->cells[idx].np = of_get_child_by_name(dev->of_node, priv->cells[idx].name);
  32. }
  33. return 0;