]> git.hungrycats.org Git - linux/commitdiff
spi: a3700: Return correct value on timeout detection
authorMaxime Chevallier <maxime.chevallier@smile.fr>
Tue, 10 Oct 2017 08:43:17 +0000 (10:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Nov 2017 08:54:46 +0000 (09:54 +0100)
commit 5a866ec0014b2baa4ecbb1eaa19c835482829d08 upstream.

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>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-armada-3700.c

index 6c7d7a460689917d577973f7bb47a1e408470210..bd822c32ae3b4404a310fe7ef3cb2f668e937bee 100644 (file)
@@ -392,7 +392,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,