spi: coldfire-qspi: Simplify the code to set register bits for transfer speed
authorAxel Lin <axel.lin@ingics.com>
Thu, 20 Mar 2014 14:59:06 +0000 (22:59 +0800)
committerMark Brown <broonie@linaro.org>
Tue, 25 Mar 2014 18:05:17 +0000 (18:05 +0000)
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>
drivers/spi/spi-coldfire-qspi.c

index 6d78f96..492ceb1 100644 (file)
@@ -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);