summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorJoachim Eastwood <manabian@gmail.com>2013-02-19 22:44:57 +0100
committerGrant Likely <grant.likely@secretlab.ca>2013-04-07 11:12:19 +0200
commit3d3522604a5557e80fdcab61c54bd04eaf15b525 (patch)
tree467281fc26111ecc33caa901db3b45c971881f39 /drivers/spi
parentMerge tag 'dm-3.9-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/a... (diff)
downloadlinux-3d3522604a5557e80fdcab61c54bd04eaf15b525.tar.xz
linux-3d3522604a5557e80fdcab61c54bd04eaf15b525.zip
spi/atmel: fix speed_hz check in atmel_spi_transfer()
atmel_spi_transfer() would check speed_hz and fail if the speed was changed in the transfer. After commit "spi: make sure all transfer has proper speed set" this would happen on all transfers. Change speed_hz check to only fail if a lower speed than max is requested. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-atmel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 656d137db253..80f5867c088b 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -847,8 +847,8 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *msg)
}
/* FIXME implement these protocol options!! */
- if (xfer->speed_hz) {
- dev_dbg(&spi->dev, "no protocol options yet\n");
+ if (xfer->speed_hz < spi->max_speed_hz) {
+ dev_dbg(&spi->dev, "can't change speed in transfer\n");
return -ENOPROTOOPT;
}