Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: au1550: Simplify au1550_spi_setupxfer()

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. This can simplify a little the
au1550_spi_setupxfer() as there is need to check only for valid
"struct spi_transfer" pointer.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Jarkko Nikula and committed by
Mark Brown
0beb0a6d 6ff33f39

+5 -6
+5 -6
drivers/spi/spi-au1550.c
··· 233 233 unsigned bpw, hz; 234 234 u32 cfg, stat; 235 235 236 - bpw = spi->bits_per_word; 237 - hz = spi->max_speed_hz; 238 236 if (t) { 239 - if (t->bits_per_word) 240 - bpw = t->bits_per_word; 241 - if (t->speed_hz) 242 - hz = t->speed_hz; 237 + bpw = t->bits_per_word; 238 + hz = t->speed_hz; 239 + } else { 240 + bpw = spi->bits_per_word; 241 + hz = spi->max_speed_hz; 243 242 } 244 243 245 244 if (!hz)