diff options
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 84c2861d6f4d..619c7df0d27f 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
@@ -1156,7 +1156,7 @@ EXPORT_SYMBOL_GPL(spi_busnum_to_master); | |||
1156 | int spi_setup(struct spi_device *spi) | 1156 | int spi_setup(struct spi_device *spi) |
1157 | { | 1157 | { |
1158 | unsigned bad_bits; | 1158 | unsigned bad_bits; |
1159 | int status; | 1159 | int status = 0; |
1160 | 1160 | ||
1161 | /* help drivers fail *cleanly* when they need options | 1161 | /* help drivers fail *cleanly* when they need options |
1162 | * that aren't supported with their current master | 1162 | * that aren't supported with their current master |
@@ -1171,7 +1171,8 @@ int spi_setup(struct spi_device *spi) | |||
1171 | if (!spi->bits_per_word) | 1171 | if (!spi->bits_per_word) |
1172 | spi->bits_per_word = 8; | 1172 | spi->bits_per_word = 8; |
1173 | 1173 | ||
1174 | status = spi->master->setup(spi); | 1174 | if (spi->master->setup) |
1175 | status = spi->master->setup(spi); | ||
1175 | 1176 | ||
1176 | dev_dbg(&spi->dev, "setup mode %d, %s%s%s%s" | 1177 | dev_dbg(&spi->dev, "setup mode %d, %s%s%s%s" |
1177 | "%u bits/w, %u Hz max --> %d\n", | 1178 | "%u bits/w, %u Hz max --> %d\n", |