811-v6.1-0007-nvmem-u-boot-env-find-Device-Tree-nodes-for-NVMEM-ce.patch 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. From d4d432670f7dee0a5432fcffcfc8699b25181ace Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
  3. Date: Fri, 16 Sep 2022 13:20:57 +0100
  4. Subject: [PATCH] nvmem: u-boot-env: 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 allows specifying NVMEM cells as NVMEM device (provider)
  9. subnodes. Looks for such subnodes when building NVMEM cells.
  10. This allows NVMEM consumers to use U-Boot environment 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/u-boot-env.c | 1 +
  17. 1 file changed, 1 insertion(+)
  18. --- a/drivers/nvmem/u-boot-env.c
  19. +++ b/drivers/nvmem/u-boot-env.c
  20. @@ -92,6 +92,7 @@ static int u_boot_env_add_cells(struct u
  21. return -ENOMEM;
  22. priv->cells[idx].offset = data_offset + value - data;
  23. priv->cells[idx].bytes = strlen(value);
  24. + priv->cells[idx].np = of_get_child_by_name(dev->of_node, priv->cells[idx].name);
  25. }
  26. if (WARN_ON(idx != priv->ncells))