mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] spi: mvebu: improve error reporting
Date: Thu,  8 Dec 2016 11:52:26 +0100	[thread overview]
Message-ID: <20161208105226.27858-2-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20161208105226.27858-1-u.kleine-koenig@pengutronix.de>

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/spi/mvebu_spi.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/mvebu_spi.c b/drivers/spi/mvebu_spi.c
index c5d8732e4f84..14ab39603cbb 100644
--- a/drivers/spi/mvebu_spi.c
+++ b/drivers/spi/mvebu_spi.c
@@ -264,13 +264,19 @@ static int mvebu_spi_do_transfer(struct spi_device *spi,
 
 	if (t->bits_per_word)
 		ret = mvebu_spi_set_transfer_size(priv, spi->bits_per_word);
-	if (ret)
+	if (ret) {
+		dev_err(&spi->dev, "Failed to set transfer size (bpw = %u)\n",
+			(unsigned)spi->bits_per_word);
 		return ret;
+	}
 
 	if (t->speed_hz)
 		ret = priv->set_baudrate(priv, t->speed_hz);
-	if (ret)
+	if (ret) {
+		dev_err(&spi->dev, "Failed to set baudrate to %u Hz\n",
+			(unsigned)t->speed_hz);
 		return ret;
+	}
 
 	inc = (priv->data16) ? 2 : 1;
 	for (n = 0; n < t->len; n += inc) {
@@ -314,8 +320,10 @@ static int mvebu_spi_transfer(struct spi_device *spi, struct spi_message *msg)
 	}
 
 	ret = mvebu_spi_set_cs(priv, spi->chip_select, spi->mode, true);
-	if (ret)
+	if (ret) {
+		dev_err(&spi->dev, "Failed to set chip select\n");
 		return ret;
+	}
 
 	msg->actual_length = 0;
 
-- 
2.10.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2016-12-08 10:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-08 10:52 [PATCH 1/2] spi: mvebu: add LSB support Uwe Kleine-König
2016-12-08 10:52 ` Uwe Kleine-König [this message]
2016-12-12  5:45 ` Sascha Hauer

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=20161208105226.27858-2-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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