diff options
author | Chris Packham <chris.packham@alliedtelesis.co.nz> | 2020-08-24 14:57:44 +1200 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2020-08-27 14:16:29 +0200 |
commit | 9b2108429ce7405e14d26c37eccd627fc35c605a (patch) | |
tree | e0e4da97614448f642e7f52bf477b9854085331c | |
parent | 1a64026eda1642c81425e48550fd4bd3f73d0ab5 (diff) | |
download | linux-stable-9b2108429ce7405e14d26c37eccd627fc35c605a.tar.gz linux-stable-9b2108429ce7405e14d26c37eccd627fc35c605a.tar.bz2 linux-stable-9b2108429ce7405e14d26c37eccd627fc35c605a.zip |
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 <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200824025744.25992-1-chris.packham@alliedtelesis.co.nz
-rw-r--r-- | drivers/mtd/maps/physmap-core.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |