From: Chris Packham Date: Mon, 24 Aug 2020 02:57:44 +0000 (+1200) Subject: mtd: maps: physmap: Retain mtd-name property from dts X-Git-Tag: v5.10-rc1~94^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9b2108429ce7405e14d26c37eccd627fc35c605a;p=thirdparty%2Flinux.git mtd: maps: physmap: Retain mtd-name property from dts 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 Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200824025744.25992-1-chris.packham@alliedtelesis.co.nz --- diff --git a/drivers/mtd/maps/physmap-core.c b/drivers/mtd/maps/physmap-core.c index 8f7f966fa9a7e..6372197ad8656 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;