mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] spi: a3700: Return correct value on timeout detection
@ 2017-10-10  8:43 Maxime Chevallier
  2017-10-10  8:43 ` [PATCH 2/2] spi: a3700: Change SPI mode before asserting chip-select Maxime Chevallier
  2017-10-10  9:19 ` Applied "spi: a3700: Return correct value on timeout detection" " Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Maxime Chevallier @ 2017-10-10  8:43 UTC (permalink / raw)
  To: linux-spi
  Cc: linux-kernel, broonie, gregory.clement, miquel.raynal, Maxime Chevallier

When waiting for transfer completion, a3700_spi_wait_completion
returns a boolean indicating if a timeout occurred.

The function was returning 'true' everytime, failing to detect any
timeout.

This patch makes it return 'false' when a timeout is reached.

Signed-off-by: Maxime Chevallier <maxime.chevallier@smile.fr>
---
 drivers/spi/spi-armada-3700.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-armada-3700.c b/drivers/spi/spi-armada-3700.c
index 9172cb2..568e1c6 100644
--- a/drivers/spi/spi-armada-3700.c
+++ b/drivers/spi/spi-armada-3700.c
@@ -387,7 +387,8 @@ static bool a3700_spi_wait_completion(struct spi_device *spi)
 
 	spireg_write(a3700_spi, A3700_SPI_INT_MASK_REG, 0);
 
-	return true;
+	/* Timeout was reached */
+	return false;
 }
 
 static bool a3700_spi_transfer_wait(struct spi_device *spi,
-- 
2.1.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-10  9:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-10  8:43 [PATCH 1/2] spi: a3700: Return correct value on timeout detection Maxime Chevallier
2017-10-10  8:43 ` [PATCH 2/2] spi: a3700: Change SPI mode before asserting chip-select Maxime Chevallier
2017-10-10  9:19   ` Applied "spi: a3700: Change SPI mode before asserting chip-select" to the spi tree Mark Brown
2017-10-10  9:19 ` Applied "spi: a3700: Return correct value on timeout detection" " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®