From: Rafał Miłecki <rafal@xxxxxxxxxx> Prefer it over $nodename. Property "label" allows more fancy / customized names with special characters. Signed-off-by: Rafał Miłecki <rafal@xxxxxxxxxx> --- drivers/nvmem/core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 23a38dcf0fc4..45c39ac401bd 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -685,6 +685,7 @@ static int nvmem_add_cells_from_of(struct nvmem_device *nvmem) struct device *dev = &nvmem->dev; struct nvmem_cell_entry *cell; const __be32 *addr; + const char *label; int len; parent = dev->of_node; @@ -708,7 +709,11 @@ static int nvmem_add_cells_from_of(struct nvmem_device *nvmem) cell->nvmem = nvmem; cell->offset = be32_to_cpup(addr++); cell->bytes = be32_to_cpup(addr); - cell->name = kasprintf(GFP_KERNEL, "%pOFn", child); + + if (!of_property_read_string(child, "label", &label)) + cell->name = kasprintf(GFP_KERNEL, "%s", label); + else + cell->name = kasprintf(GFP_KERNEL, "%pOFn", child); addr = of_get_property(child, "bits", &len); if (addr && len == (2 * sizeof(u32))) { -- 2.31.1