Skip to content

Commit

Permalink
nvmem: u-boot-env: find Device Tree nodes for NVMEM cells
Browse files Browse the repository at this point in the history
DT binding allows specifying NVMEM cells as NVMEM device (provider)
subnodes. Looks for such subnodes when building NVMEM cells.

This allows NVMEM consumers to use U-Boot environment 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/20220916122100.170016-11-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Rafał Miłecki authored and Greg Kroah-Hartman committed Sep 24, 2022
1 parent 8f6a3a1 commit d4d4326
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/nvmem/u-boot-env.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ static int u_boot_env_add_cells(struct u_boot_env *priv, uint8_t *buf,
return -ENOMEM;
priv->cells[idx].offset = data_offset + value - data;
priv->cells[idx].bytes = strlen(value);
priv->cells[idx].np = of_get_child_by_name(dev->of_node, priv->cells[idx].name);
}

if (WARN_ON(idx != priv->ncells))
Expand Down

0 comments on commit d4d4326

Please sign in to comment.