spi: spi-ti-qspi: Fix return value handling of wait_for_completion_timeout
authorMiaoqian Lin <linmq006@gmail.com>
Mon, 11 Apr 2022 11:10:33 +0000 (11:10 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 11 Apr 2022 18:19:53 +0000 (19:19 +0100)
commit8b1ea69a63eb62f97cef63e6d816b64ed84e8760
tree67fd3b84eedfb880db5626a7bbb34ebff80256bb
parent4df6836dbbdb6a00af5f9ab6233e33cec3a73961
spi: spi-ti-qspi: Fix return value handling of wait_for_completion_timeout

wait_for_completion_timeout() returns unsigned long not int.
It returns 0 if timed out, and positive if completed.
The check for <= 0 is ambiguous and should be == 0 here
indicating timeout which is the only error case.

Fixes: 5720ec0a6d26 ("spi: spi-ti-qspi: Add DMA support for QSPI mmap read")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220411111034.24447-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-ti-qspi.c