mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
spi: fsl-espi: simplify fsl_espi_setup_transfer
If t is not null then the SPI core takes care that bits_per_word and speed_hz are populated. This allows to simplify fsl_espi_setup_transfer. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
parent
38d003f1a4
commit
d198ebfb75
1 changed files with 2 additions and 14 deletions
|
|
@ -176,23 +176,11 @@ static void fsl_espi_setup_transfer(struct spi_device *spi,
|
|||
struct spi_transfer *t)
|
||||
{
|
||||
struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
|
||||
int bits_per_word = 0;
|
||||
int bits_per_word = t ? t->bits_per_word : spi->bits_per_word;
|
||||
u32 hz = t ? t->speed_hz : spi->max_speed_hz;
|
||||
u8 pm;
|
||||
u32 hz = 0;
|
||||
struct spi_mpc8xxx_cs *cs = spi->controller_state;
|
||||
|
||||
if (t) {
|
||||
bits_per_word = t->bits_per_word;
|
||||
hz = t->speed_hz;
|
||||
}
|
||||
|
||||
/* spi_transfer level calls that work per-word */
|
||||
if (!bits_per_word)
|
||||
bits_per_word = spi->bits_per_word;
|
||||
|
||||
if (!hz)
|
||||
hz = spi->max_speed_hz;
|
||||
|
||||
cs->rx_shift = 0;
|
||||
cs->tx_shift = 0;
|
||||
cs->get_rx = mpc8xxx_spi_rx_buf_u32;
|
||||
|
|
|
|||
Loading…
Reference in a new issue