Skip to contentSkip to conversation

mtd: physmap: Fix mtd device name

PATCH In review Victor Fusco 2 participants 2 messages Mar 19, 2020 – Apr 27, 2020 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: physmap: Fix mtd device name

This patch fixes the mtd device name when the "linux,mtd-name" field is defined on the Device Tree. A verification to check if the name was already defined was missing causing the name to be overwritten with a default value.

---
 drivers/mtd/maps/physmap-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mtd/maps/physmap-core.c +2 -1
index 8f7f966fa9a7..6372197ad865 100644
@@ -515,7 +515,8 @@ static int physmap_flash_probe(struct platform_device *dev)
 		dev_notice(&dev->dev, "physmap platform flash device: %pR\n",
 			   res);
 
-		info->maps[i].name = dev_name(&dev->dev);
+		if (!info->maps[i].name)
+			info->maps[i].name = dev_name(&dev->dev);
 
 		if (!info->maps[i].phys)
 			info->maps[i].phys = res->start;

base-commit: 5076190daded2197f62fe92cf69674488be44175

Signature · 6 lines
2.17.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
maintainer Reviewed-by on v1 1/1
#1 lore raw

Hi Victor,

Please add the maintainers in copy of your patch next time. Otherwise you might wait a lot before we even figure that you sent us something.

Victor Fusco <[email protected]> wrote on Thu, 19 Mar 2020 14:38:33 +0000:

Quoted 16 lines

This patch fixes the mtd device name when the "linux,mtd-name" field is defined on the Device Tree. A verification to check if the name was already defined was missing causing the name to be overwritten with a default value.

---
 drivers/mtd/maps/physmap-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mtd/maps/physmap-core.c +0 -0
index 8f7f966fa9a7..6372197ad865 100644

drivers/mtd/maps/physmap-core.c static int physmap_flash_probe(struct platform_device *dev) · line 522

Quoted 9 lines
drivers/mtd/maps/physmap-core.c +2 -1
@@ -515,7 +515,8 @@ static int physmap_flash_probe(struct platform_device *dev)
 		dev_notice(&dev->dev, "physmap platform flash device: %pR\n",
 			   res);
 
-		info->maps[i].name = dev_name(&dev->dev);
+		if (!info->maps[i].name)
+			info->maps[i].name = dev_name(&dev->dev);
 
 		if (!info->maps[i].phys)
 			info->maps[i].phys = res->start;

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/