[PATCH v1 7/7] nvmem: rmem: Use unique device name for NVMEM registration

Oleksij Rempel o.rempel at pengutronix.de
Fri May 30 04:41:06 PDT 2025


Ensure that each rmem NVMEM instance is registered with a unique
name by using dev_name(dev) instead of a static "rmem" string
for config.name during probe.

Previously, all rmem instances would attempt to register with the
NVMEM framework using the same name ("rmem"). This caused issues
when multiple rmem devices were present, as the NVMEM framework
(and subsequently the char device layer) would create conflicting
device nodes or prevent the creation of additional rmem instances
beyond the first one.

By using the unique device name provided by dev_name(dev) (e.g.,
"rmem0", "rmem1"), each rmem instance is now distinctly identifiable
by the NVMEM core, allowing multiple rmem devices to be created and
used concurrently without naming collisions.

Signed-off-by: Oleksij Rempel <o.rempel at pengutronix.de>
---
 drivers/nvmem/rmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvmem/rmem.c b/drivers/nvmem/rmem.c
index be3203de73d3..ddbfa766f03d 100644
--- a/drivers/nvmem/rmem.c
+++ b/drivers/nvmem/rmem.c
@@ -471,7 +471,7 @@ static int rmem_probe(struct device *dev)
 
 	config.dev = priv->dev = dev;
 	config.priv = priv;
-	config.name = "rmem";
+	config.name = dev_name(dev);
 	config.size = resource_size(mem);
 	priv->total_size = config.size;
 
-- 
2.39.5




More information about the barebox mailing list