linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: spi-cadence-quadspi: Populate get_name() interface
@ 2020-08-25 17:25 Vignesh Raghavendra
  2020-08-25 20:43 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Vignesh Raghavendra @ 2020-08-25 17:25 UTC (permalink / raw)
  To: Mark Brown
  Cc: Tudor Ambarus, Ramuthevar Vadivel Murugan, Vignesh Raghavendra,
	Jan Kiszka, Boris Brezillon, Pratyush Yadav, linux-spi,
	linux-kernel

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: 31fb632b5d43c ("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>
---
 drivers/spi/spi-cadence-quadspi.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 1c1a9d17eec0d..508b219eabf80 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1128,8 +1128,17 @@ static int cqspi_request_mmap_dma(struct cqspi_st *cqspi)
 	return 0;
 }
 
+static const char *cqspi_get_name(struct spi_mem *mem)
+{
+	struct cqspi_st *cqspi = spi_master_get_devdata(mem->spi->master);
+	struct device *dev = &cqspi->pdev->dev;
+
+	return devm_kasprintf(dev, GFP_KERNEL, "%s.%d", dev_name(dev), mem->spi->chip_select);
+}
+
 static const struct spi_controller_mem_ops cqspi_mem_ops = {
 	.exec_op = cqspi_exec_mem_op,
+	.get_name = cqspi_get_name,
 };
 
 static int cqspi_setup_flash(struct cqspi_st *cqspi)
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] spi: spi-cadence-quadspi: Populate get_name() interface
  2020-08-25 17:25 [PATCH] spi: spi-cadence-quadspi: Populate get_name() interface Vignesh Raghavendra
@ 2020-08-25 20:43 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2020-08-25 20:43 UTC (permalink / raw)
  To: Vignesh Raghavendra
  Cc: Ramuthevar Vadivel Murugan, Tudor Ambarus, Boris Brezillon,
	linux-kernel, Pratyush Yadav, Jan Kiszka, linux-spi

On Tue, 25 Aug 2020 22:55:06 +0530, Vignesh Raghavendra wrote:
> 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.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: spi-cadence-quadspi: Populate get_name() interface
      commit: 2ea370a9173f4a3c80b24221049359a5d1518bc0

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-25 20:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-25 17:25 [PATCH] spi: spi-cadence-quadspi: Populate get_name() interface Vignesh Raghavendra
2020-08-25 20:43 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).