未验证 提交 b02b17f5 编写于 作者: F Frieder Schrempf 提交者: Mark Brown

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: NBoris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: NFrieder Schrempf <frieder.schrempf@exceet.de>
Acked-by: NBoris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 5d27a9c8
......@@ -202,6 +202,9 @@ static int m25p_probe(struct spi_mem *spimem)
if (data && data->name)
nor->mtd.name = data->name;
if (!nor->mtd.name)
nor->mtd.name = spi_mem_get_name(spimem);
/* For some (historical?) reason many platforms provide two different
* names in flash_platform_data: "name" and "type". Quite often name is
* set to "m25p80" and then "type" provides a real chip name.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册