Skip to contentSkip to conversation

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

PATCH Applied Axel Lin 2 participants 2 messages Mar 20, 2014 – Mar 25, 2014 SPI

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 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().

---
 drivers/spi/spi-coldfire-qspi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/spi/spi-coldfire-qspi.c +1 -4
index e36c7cb..e2fa628 100644
@@ -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);
Signature · 8 lines
1.8.3.2



--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Applied
#1 lore raw
Quoted 2 lines · Axel Lin

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.