Skip to content

Commit

Permalink
spi: coldfire-qspi: Simplify the code to set register bits for transf…
Browse files Browse the repository at this point in the history
…er speed

spi core will use spi->max_speed_hz as transfer speed if the transfer speed was
not set. So we don't need to test t->speed_hz in mcfqspi_transfer_one().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Axel Lin authored and Mark Brown committed Mar 25, 2014
1 parent 2271cf1 commit 8023d38
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/spi/spi-coldfire-qspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,7 @@ static int mcfqspi_transfer_one(struct spi_master *master,
qmr |= MCFQSPI_QMR_CPHA;
if (spi->mode & SPI_CPOL)
qmr |= MCFQSPI_QMR_CPOL;
if (t->speed_hz)
qmr |= mcfqspi_qmr_baud(t->speed_hz);
else
qmr |= mcfqspi_qmr_baud(spi->max_speed_hz);
qmr |= mcfqspi_qmr_baud(t->speed_hz);
mcfqspi_wr_qmr(mcfqspi, qmr);

mcfqspi_wr_qir(mcfqspi, MCFQSPI_QIR_SPIFE);
Expand Down

0 comments on commit 8023d38

Please sign in to comment.