blob: 3a6b76a221e5bc78c62d2b4e9b1c587ac1e9f20b [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From d69efcf951df4dcc74a0e1554969c533aec8aa9b Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3Date: Thu, 15 Sep 2022 22:06:29 +0200
4Subject: [PATCH] nvmem: u-boot-env: find Device Tree nodes for NVMEM cells
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9DT binding allows specifying NVMEM cells as NVMEM device (provider)
10subnodes. Looks for such subnodes when building NVMEM cells.
11
12This allows NVMEM consumers to use U-Boot environment variables.
13
14Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
15Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
16---
17 drivers/nvmem/u-boot-env.c | 1 +
18 1 file changed, 1 insertion(+)
19
20--- a/drivers/nvmem/u-boot-env.c
21+++ b/drivers/nvmem/u-boot-env.c
22@@ -92,6 +92,7 @@ static int u_boot_env_add_cells(struct u
23 return -ENOMEM;
24 priv->cells[idx].offset = data_offset + value - data;
25 priv->cells[idx].bytes = strlen(value);
26+ priv->cells[idx].np = of_get_child_by_name(dev->of_node, priv->cells[idx].name);
27 }
28
29 if (WARN_ON(idx != priv->ncells))