Skip to content

Commit b02b17f

Browse files
fschrempfbroonie
authored andcommitted
mtd: m25p80: Call spi_mem_get_name() to let controller set a custom name
By calling spi_mem_get_name(), the driver of the (Q)SPI controller can set a custom name for the memory device if necessary. This is useful to keep mtdparts compatible when controller drivers are ported from the MTD to the SPI layer. Suggested-by: Boris Brezillon <[email protected]> Signed-off-by: Frieder Schrempf <[email protected]> Acked-by: Boris Brezillon <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 5d27a9c commit b02b17f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/mtd/devices/m25p80.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ static int m25p_probe(struct spi_mem *spimem)
202202
if (data && data->name)
203203
nor->mtd.name = data->name;
204204

205+
if (!nor->mtd.name)
206+
nor->mtd.name = spi_mem_get_name(spimem);
207+
205208
/* For some (historical?) reason many platforms provide two different
206209
* names in flash_platform_data: "name" and "type". Quite often name is
207210
* set to "m25p80" and then "type" provides a real chip name.

0 commit comments

Comments
 (0)