mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@smile.fr>
To: linux-spi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, broonie@kernel.org,
	gregory.clement@free-electrons.com,
	miquel.raynal@free-electrons.com,
	Maxime Chevallier <maxime.chevallier@smile.fr>
Subject: [PATCH 1/2] spi: a3700: Return correct value on timeout detection
Date: Tue, 10 Oct 2017 10:43:17 +0200	[thread overview]
Message-ID: <1507624998-31425-1-git-send-email-maxime.chevallier@smile.fr> (raw)

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

             reply	other threads:[~2017-10-10  8:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10  8:43 Maxime Chevallier [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1507624998-31425-1-git-send-email-maxime.chevallier@smile.fr \
    --to=maxime.chevallier@smile.fr \
    --cc=broonie@kernel.org \
    --cc=gregory.clement@free-electrons.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=miquel.raynal@free-electrons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®