aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2015-10-14 15:43:07 -0400
committerMark Brown <broonie@kernel.org>2015-10-16 11:05:33 -0400
commit5ab8d262122bc951b308e51cdcc55bc67b1f5fdb (patch)
treed55527ce037ab3b85b96ce906bea8986faa07f38
parent44af7927316e83eb8865933f7c836dcc85f8eb74 (diff)
spi: core: propagate return code of __spi_validate_bits_per_word()
Propagate the actual return code of __spi_validate_bits_per_word() in spi_setup(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 40c9afac047f..64c1aedde481 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1956,7 +1956,7 @@ static int __spi_validate_bits_per_word(struct spi_master *master, u8 bits_per_w
1956int spi_setup(struct spi_device *spi) 1956int spi_setup(struct spi_device *spi)
1957{ 1957{
1958 unsigned bad_bits, ugly_bits; 1958 unsigned bad_bits, ugly_bits;
1959 int status = 0; 1959 int status;
1960 1960
1961 /* check mode to prevent that DUAL and QUAD set at the same time 1961 /* check mode to prevent that DUAL and QUAD set at the same time
1962 */ 1962 */
@@ -1993,8 +1993,9 @@ int spi_setup(struct spi_device *spi)
1993 if (!spi->bits_per_word) 1993 if (!spi->bits_per_word)
1994 spi->bits_per_word = 8; 1994 spi->bits_per_word = 8;
1995 1995
1996 if (__spi_validate_bits_per_word(spi->master, spi->bits_per_word)) 1996 status = __spi_validate_bits_per_word(spi->master, spi->bits_per_word);
1997 return -EINVAL; 1997 if (status)
1998 return status;
1998 1999
1999 if (!spi->max_speed_hz) 2000 if (!spi->max_speed_hz)
2000 spi->max_speed_hz = spi->master->max_speed_hz; 2001 spi->max_speed_hz = spi->master->max_speed_hz;