summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2015-08-20 11:52:18 -0700
committerMark Brown <broonie@kernel.org>2015-08-21 10:24:04 -0700
commit7dc9fbc342deb2e2658ebdecb5ffd7ff57945a66 (patch)
treec80301fb53fda55f58c89eebbce0f37f0096159d /drivers/spi/spi.c
parentbc0195aad0daa2ad5b0d76cce22b167bc3435590 (diff)
downloadlinux-7dc9fbc342deb2e2658ebdecb5ffd7ff57945a66.tar.bz2
spi: Fall back to master maximum speed if no slave speed specified
If a slave appears with no maximum transfer speed specified fall back to using the maximum for the master instead. It's questionable if we should let slaves do this but let's be defensive. Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r--drivers/spi/spi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index cf8b91b23a76..637d892b316d 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1860,6 +1860,8 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message)
if (!xfer->speed_hz)
xfer->speed_hz = spi->max_speed_hz;
+ if (!xfer->speed_hz)
+ xfer->speed_hz = master->max_speed_hz;
if (master->max_speed_hz &&
xfer->speed_hz > master->max_speed_hz)