diff mbox

spi: coldfire-qspi: Simplify the code to set register bits for transfer speed

Message ID 1395327546.25840.1.camel@phoenix (mailing list archive)
State Accepted
Commit 8023d384ff5c55a431c1a9a84cd76648d43ba7d8
Headers show

Commit Message

Axel Lin March 20, 2014, 2:59 p.m. UTC
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>
---
 drivers/spi/spi-coldfire-qspi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Mark Brown March 25, 2014, 6:05 p.m. UTC | #1
On Thu, Mar 20, 2014 at 10:59:06PM +0800, Axel Lin wrote:
> 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().

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c
index e36c7cb..e2fa628 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);