From 8023d384ff5c55a431c1a9a84cd76648d43ba7d8 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 20 Mar 2014 22:59:06 +0800 Subject: [PATCH] spi: coldfire-qspi: Simplify the code to set register bits for transfer 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 Signed-off-by: Mark Brown --- drivers/spi/spi-coldfire-qspi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c index 6d78f96bdc55..492ceb1654e5 100644 --- a/drivers/spi/spi-coldfire-qspi.c +++ b/drivers/spi/spi-coldfire-qspi.c @@ -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); -- 2.20.1