Skip to content

Commit

Permalink
spi/atmel: fix speed_hz check in atmel_spi_transfer()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joachim Eastwood authored and Grant Likely committed Apr 7, 2013
1 parent fe69690 commit 3d35226
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-atmel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 3d35226

Please sign in to comment.