summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@foss.st.com>2022-06-02 12:10:22 +0300
committerMark Brown <broonie@kernel.org>2022-06-06 14:32:27 +0300
commit2283679f4c468df367830b7eb8f22d48a6940e19 (patch)
tree6600be3b791cb59391e845128faacb04bcad0677 /drivers
parent7b40322f7183a92c4303457528ae7cda571c60b9 (diff)
downloadlinux-2283679f4c468df367830b7eb8f22d48a6940e19.tar.xz
spi: spi-mem: Fix spi_mem_poll_status()
In spi_mem_exec_op(), in case cs_gpiod descriptor is set, exec_op() callback can't be used. The same must be applied in spi_mem_poll_status(), poll_status() callback can't be used, we must use the legacy path using read_poll_timeout(). Tested on STM32mp257c-ev1 specific evaluation board on which a spi-nand was mounted instead of a spi-nor. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Tested-by: Patrice Chotard <patrice.chotard@foss.st.com> Link: https://lore.kernel.org/r/20220602091022.358127-1-patrice.chotard@foss.st.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/spi/spi-mem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index e8de4f5017cd..0c79193d9697 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -808,7 +808,7 @@ int spi_mem_poll_status(struct spi_mem *mem,
op->data.dir != SPI_MEM_DATA_IN)
return -EINVAL;
- if (ctlr->mem_ops && ctlr->mem_ops->poll_status) {
+ if (ctlr->mem_ops && ctlr->mem_ops->poll_status && !mem->spi->cs_gpiod) {
ret = spi_mem_access_start(mem);
if (ret)
return ret;