Skip to contentSkip to conversation

spi: altera_spi: fix altera_spi_setup() return error codes

PATCH Applied Antony Pavlov 2 participants 2 messages Apr 7, 2014 – Apr 8, 2014 SPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: altera_spi: fix altera_spi_setup() return error codes

---
 drivers/spi/altera_spi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/spi/altera_spi.c +3 -3
index 8803d9e..983b877 100644
@@ -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);
Signature · 7 lines
1.9.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 2 lines · Antony Pavlov

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

Sascha

Quoted 34 lines
---
 drivers/spi/altera_spi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/spi/altera_spi.c +3 -3
index 8803d9e..983b877 100644
@@ -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);
Signature · 1 line
1.9.0
Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox