spi: coldfire-qspi: Simplify the code to set register bits for transfer speed
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().
Signed-off-by Axel Lin <[email protected]>
--- drivers/spi/spi-coldfire-qspi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/spi/spi-coldfire-qspi.c +1 -4
@@ -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
Mark Brown
AppliedQuoted 2 lines · Axel Lin
spi core will use
spi->max_speed_hzas transfer speed if the transfer speed was not set. So we don't need to testt->speed_hzinmcfqspi_transfer_one().
Applied, thanks.