Skip to content

Commit 0cf8d32

Browse files
Patrice Chotardbroonie
authored andcommitted
spi: stm32-qspi: Always check SR_TCF flags in stm32_qspi_wait_cmd()
Currently, SR_TCF flag is checked in case there is data, this criteria is not correct. SR_TCF flags is set when programmed number of bytes has been transferred to the memory device ("bytes" comprised command and data send to the SPI device). So even if there is no data, we must check SR_TCF flag. Signed-off-by: Patrice Chotard <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent d83d89e commit 0cf8d32

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

drivers/spi/spi-stm32-qspi.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,6 @@ static int stm32_qspi_wait_cmd(struct stm32_qspi *qspi,
305305
u32 cr, sr;
306306
int err = 0;
307307

308-
if (!op->data.nbytes)
309-
goto wait_nobusy;
310-
311308
if ((readl_relaxed(qspi->io_base + QSPI_SR) & SR_TCF) ||
312309
qspi->fmode == CCR_FMODE_APM)
313310
goto out;
@@ -328,7 +325,6 @@ static int stm32_qspi_wait_cmd(struct stm32_qspi *qspi,
328325
out:
329326
/* clear flags */
330327
writel_relaxed(FCR_CTCF | FCR_CTEF, qspi->io_base + QSPI_FCR);
331-
wait_nobusy:
332328
if (!err)
333329
err = stm32_qspi_wait_nobusy(qspi);
334330

0 commit comments

Comments
 (0)