2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-20 03:04:01 +08:00

spi: pxa2xx: Remove two variables from struct chip_data

There is no need to carry spi->max_speed_hz and spi->bits_per_word from
setup() in "struct chip_data" since pump_transfers() will anyway take the
transfer parameters from "struct spi_transfer". This is since SPI core
validates both bits_per_word and speed_hz transfer parameters and defaults
to spi->bits_per_word and spi->max_speed_hz in case these per transfer
parameters are not set.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Jarkko Nikula 2015-09-15 16:26:26 +03:00 committed by Mark Brown
parent 6ff33f3902
commit 4f1474b3b7
2 changed files with 2 additions and 12 deletions

View File

@ -921,14 +921,8 @@ static void pump_transfers(unsigned long data)
cr0 = chip->cr0;
if (transfer->speed_hz || transfer->bits_per_word) {
bits = chip->bits_per_word;
speed = chip->speed_hz;
if (transfer->speed_hz)
speed = transfer->speed_hz;
if (transfer->bits_per_word)
bits = transfer->bits_per_word;
bits = transfer->bits_per_word;
speed = transfer->speed_hz;
clk_div = pxa2xx_ssp_get_clk_div(drv_data, chip, speed);
@ -1200,7 +1194,6 @@ static int setup(struct spi_device *spi)
}
clk_div = pxa2xx_ssp_get_clk_div(drv_data, chip, spi->max_speed_hz);
chip->speed_hz = spi->max_speed_hz;
chip->cr0 = pxa2xx_configure_sscr0(drv_data, clk_div,
spi->bits_per_word);
@ -1251,7 +1244,6 @@ static int setup(struct spi_device *spi)
chip->read = u32_reader;
chip->write = u32_writer;
}
chip->bits_per_word = spi->bits_per_word;
spi_set_ctldata(spi, chip);

View File

@ -98,8 +98,6 @@ struct chip_data {
u16 lpss_rx_threshold;
u16 lpss_tx_threshold;
u8 enable_dma;
u8 bits_per_word;
u32 speed_hz;
union {
int gpio_cs;
unsigned int frm;