Skip to content

Commit 2283679

Browse files
Patrice Chotardbroonie
authored andcommitted
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 <[email protected]> Tested-by: Patrice Chotard <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 7b40322 commit 2283679

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi-mem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ int spi_mem_poll_status(struct spi_mem *mem,
808808
op->data.dir != SPI_MEM_DATA_IN)
809809
return -EINVAL;
810810

811-
if (ctlr->mem_ops && ctlr->mem_ops->poll_status) {
811+
if (ctlr->mem_ops && ctlr->mem_ops->poll_status && !mem->spi->cs_gpiod) {
812812
ret = spi_mem_access_start(mem);
813813
if (ret)
814814
return ret;

0 commit comments

Comments
 (0)