Commit 2283679f authored by Patrice Chotard's avatar Patrice Chotard Committed by Mark Brown

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: default avatarPatrice Chotard <patrice.chotard@foss.st.com>
Tested-by: default avatarPatrice Chotard <patrice.chotard@foss.st.com>
Link: https://lore.kernel.org/r/20220602091022.358127-1-patrice.chotard@foss.st.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7b40322f
...@@ -808,7 +808,7 @@ int spi_mem_poll_status(struct spi_mem *mem, ...@@ -808,7 +808,7 @@ int spi_mem_poll_status(struct spi_mem *mem,
op->data.dir != SPI_MEM_DATA_IN) op->data.dir != SPI_MEM_DATA_IN)
return -EINVAL; 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); ret = spi_mem_access_start(mem);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment