diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2009-06-17 19:26:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-18 16:03:42 -0400 |
commit | 7d0771970c51e736758525dd71fb82dd036b823a (patch) | |
tree | 9ff72b89cd06cd67e0db681859606dd77f5cba80 /drivers/spi/spi_bfin5xx.c | |
parent | b4bd2ababd20b6ecdd49cf96e39c875fbedd53af (diff) |
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>
Diffstat (limited to 'drivers/spi/spi_bfin5xx.c')
-rw-r--r-- | drivers/spi/spi_bfin5xx.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c index 2e5fd0977334..d54058a903be 100644 --- a/drivers/spi/spi_bfin5xx.c +++ b/drivers/spi/spi_bfin5xx.c | |||
@@ -1016,10 +1016,6 @@ static int bfin_spi_setup(struct spi_device *spi) | |||
1016 | return -EINVAL; | 1016 | return -EINVAL; |
1017 | } | 1017 | } |
1018 | 1018 | ||
1019 | /* Zero (the default) here means 8 bits */ | ||
1020 | if (!spi->bits_per_word) | ||
1021 | spi->bits_per_word = 8; | ||
1022 | |||
1023 | if (spi->bits_per_word != 8 && spi->bits_per_word != 16) | 1019 | if (spi->bits_per_word != 8 && spi->bits_per_word != 16) |
1024 | return -EINVAL; | 1020 | return -EINVAL; |
1025 | 1021 | ||