aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;