]> git.baikalelectronics.ru Git - kernel.git/commit
spi: synquacer: Fix timeout handling in synquacer_spi_transfer_one()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Wed, 15 Feb 2023 13:01:28 +0000 (14:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:43:47 +0000 (16:43 +0100)
commitd9abdfda8574048db7211661bcf764a4bcc9aa63
treec5cd6c043a245468fc766577c71e805bd49fedc9
parent1629c200eaf84c99d4fed17f6d1f7d0780aca38f
spi: synquacer: Fix timeout handling in synquacer_spi_transfer_one()

[ Upstream commit e6a0b671880207566e1ece983bf989dde60bc1d7 ]

wait_for_completion_timeout() never returns a <0 value. It returns either
on timeout or a positive value (at least 1, or number of jiffies left
till timeout)

So, fix the error handling path and return -ETIMEDOUT should a timeout
occur.

Fixes: 55922e05ef32 ("spi: Add spi driver for Socionext SynQuacer platform")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
Link: https://lore.kernel.org/r/c2040bf3cfa201fd8890cfab14fa5a701ffeca14.1676466072.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-synquacer.c