]> git.baikalelectronics.ru Git - kernel.git/commit
spi: spi-mem: Extend the SPI mem interface to set a custom memory name
authorFrieder Schrempf <frieder.schrempf@exceet.de>
Thu, 2 Aug 2018 12:53:53 +0000 (14:53 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 2 Aug 2018 14:35:41 +0000 (15:35 +0100)
commitda931e8fa02ec9124b07d122f9edb548e447234a
tree81c1eee84492a7b65a991d5069838b86227414c0
parent1c459f6981096eda5d9561867a9fd0aeb6ade1dd
spi: spi-mem: Extend the SPI mem interface to set a custom memory name

When porting (Q)SPI controller drivers from the MTD layer to the SPI
layer, the naming scheme for the memory devices changes. To be able
to keep compatibility with the old drivers naming scheme, a name
field is added to struct spi_mem and a hook is added to let controller
drivers set a custom name for the memory device.

Example for the FSL QSPI driver:

Name with the old driver: 21e0000.qspi,
or with multiple devices: 21e0000.qspi-0, 21e0000.qspi-1, ...

Name with the new driver without spi_mem_get_name: spi4.0

Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Frieder Schrempf <frieder.schrempf@exceet.de>
Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-mem.c
include/linux/spi/spi-mem.h