diff mbox series

mtd: maps: physmap: Retain mtd-name property from dts

Message ID 20200824025744.25992-1-chris.packham@alliedtelesis.co.nz
State Accepted
Delegated to: Miquel Raynal
Headers show
Series mtd: maps: physmap: Retain mtd-name property from dts | expand

Commit Message

Chris Packham Aug. 24, 2020, 2:57 a.m. UTC
In physmap_flash_of_init() the maps[].name can be populated based on the
optional 'linux,mtd-name' property in the dts. Make sure this is
retained when filling in the rest of the map[] data.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
 drivers/mtd/maps/physmap-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Miquel Raynal Sept. 7, 2020, 7:34 a.m. UTC | #1
On Mon, 2020-08-24 at 02:57:44 UTC, Chris Packham wrote:
> In physmap_flash_of_init() the maps[].name can be populated based on the
> optional 'linux,mtd-name' property in the dts. Make sure this is
> retained when filling in the rest of the map[] data.
> 
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel
diff mbox series

Patch

diff --git a/drivers/mtd/maps/physmap-core.c b/drivers/mtd/maps/physmap-core.c
index 8f7f966fa9a7..6372197ad865 100644
--- a/drivers/mtd/maps/physmap-core.c
+++ b/drivers/mtd/maps/physmap-core.c
@@ -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;