mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH] spi: altera_spi: fix altera_spi_setup() return error codes
Date: Mon,  7 Apr 2014 11:50:39 +0400	[thread overview]
Message-ID: <1396857039-17837-1-git-send-email-antonynpavlov@gmail.com> (raw)

Reported-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 drivers/spi/altera_spi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/altera_spi.c b/drivers/spi/altera_spi.c
index 8803d9e..983b877 100644
--- a/drivers/spi/altera_spi.c
+++ b/drivers/spi/altera_spi.c
@@ -34,18 +34,18 @@ static int altera_spi_setup(struct spi_device *spi)
 	if (spi->bits_per_word != altera_spi->databits) {
 		dev_err(master->dev, " master doesn't support %d bits per word requested by %s\n",
 			spi->bits_per_word, spi_dev.name);
-		return -1;
+		return -EINVAL;
 	}
 
 	if ((spi->mode & (SPI_CPHA | SPI_CPOL)) != altera_spi->mode) {
 		dev_err(master->dev, " master doesn't support SPI_MODE%d requested by %s\n",
 			spi->mode & (SPI_CPHA | SPI_CPOL), spi_dev.name);
-		return -1;
+		return -EINVAL;
 	}
 
 	if (spi->max_speed_hz < altera_spi->speed) {
 		dev_err(master->dev, " frequency is too high for %s\n", spi_dev.name);
-		return -1;
+		return -EINVAL;
 	}
 
 	altera_spi_cs_inactive(spi);
-- 
1.9.0


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

             reply	other threads:[~2014-04-07  7:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-07  7:50 Antony Pavlov [this message]
2014-04-08  6:09 ` 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=1396857039-17837-1-git-send-email-antonynpavlov@gmail.com \
    --to=antonynpavlov@gmail.com \
    --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