Skip to content

Commit 2ea370a

Browse files
r-vigneshbroonie
authored andcommitted
spi: spi-cadence-quadspi: Populate get_name() interface
Implement get_name() interface of spi_controller_mem_ops so as to avoid changing of mtd->name due to driver being moved over to spi-mem framework from SPI NOR. This avoids breaking of MTD cmdline args being passed by bootloaders which maybe using old driver name. Fixes: 31fb632 ("spi: Move cadence-quadspi driver to drivers/spi/") Reported-by: Jan Kiszka <jan.kiszka@siemens.com> Suggested-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Link: https://lore.kernel.org/r/20200825172506.14375-1-vigneshr@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 3cb5fcf commit 2ea370a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/spi/spi-cadence-quadspi.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,8 +1128,17 @@ static int cqspi_request_mmap_dma(struct cqspi_st *cqspi)
11281128
return 0;
11291129
}
11301130

1131+
static const char *cqspi_get_name(struct spi_mem *mem)
1132+
{
1133+
struct cqspi_st *cqspi = spi_master_get_devdata(mem->spi->master);
1134+
struct device *dev = &cqspi->pdev->dev;
1135+
1136+
return devm_kasprintf(dev, GFP_KERNEL, "%s.%d", dev_name(dev), mem->spi->chip_select);
1137+
}
1138+
11311139
static const struct spi_controller_mem_ops cqspi_mem_ops = {
11321140
.exec_op = cqspi_exec_mem_op,
1141+
.get_name = cqspi_get_name,
11331142
};
11341143

11351144
static int cqspi_setup_flash(struct cqspi_st *cqspi)

0 commit comments

Comments
 (0)