mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] spi: altera_spi: fix altera_spi_setup() return error codes
@ 2014-04-07  7:50 Antony Pavlov
  2014-04-08  6:09 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Antony Pavlov @ 2014-04-07  7:50 UTC (permalink / raw)
  To: barebox

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

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

* Re: [PATCH] spi: altera_spi: fix altera_spi_setup() return error codes
  2014-04-07  7:50 [PATCH] spi: altera_spi: fix altera_spi_setup() return error codes Antony Pavlov
@ 2014-04-08  6:09 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2014-04-08  6:09 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

On Mon, Apr 07, 2014 at 11:50:39AM +0400, Antony Pavlov wrote:
> Reported-by: Sascha Hauer <s.hauer@pengutronix.de>
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>

Applied. Thanks for fixing this, now there's one place less to copy
wrong code :)

Sascha

> ---
>  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
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

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

end of thread, other threads:[~2014-04-08  6:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-07  7:50 [PATCH] spi: altera_spi: fix altera_spi_setup() return error codes Antony Pavlov
2014-04-08  6:09 ` Sascha Hauer

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