spi: move common spi_setup() functionality into core
Start moving some spi_setup() functionality into the SPI core from the various spi_master controller drivers: - Make that function stop being an inline; - Move two common idioms from drivers into that new function: * Default bits_per_word to 8 if that field isn't set * Issue a standardized dev_dbg() message This is a net minor source code shrink, and supports enhancments found in some follow-up patches. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
b4bd2ababd
commit
7d0771970c
@ -555,8 +555,6 @@ static int atmel_spi_setup(struct spi_device *spi)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (bits == 0)
|
||||
bits = 8;
|
||||
if (bits < 8 || bits > 16) {
|
||||
dev_dbg(&spi->dev,
|
||||
"setup: invalid bits_per_word %u (8 to 16)\n",
|
||||
|
Reference in New Issue
Block a user