aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi_imx.c
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-06-17 19:26:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-18 16:03:42 -0400
commit7d0771970c51e736758525dd71fb82dd036b823a (patch)
tree9ff72b89cd06cd67e0db681859606dd77f5cba80 /drivers/spi/spi_imx.c
parentb4bd2ababd20b6ecdd49cf96e39c875fbedd53af (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_imx.c')
-rw-r--r--drivers/spi/spi_imx.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
index 0671aeef5792..26d5ef06dbd9 100644
--- a/drivers/spi/spi_imx.c
+++ b/drivers/spi/spi_imx.c
@@ -1286,10 +1286,7 @@ static int setup(struct spi_device *spi)
1286 1286
1287 /* SPI word width */ 1287 /* SPI word width */
1288 tmp = spi->bits_per_word; 1288 tmp = spi->bits_per_word;
1289 if (tmp == 0) { 1289 if (tmp > 16) {
1290 tmp = 8;
1291 spi->bits_per_word = 8;
1292 } else if (tmp > 16) {
1293 status = -EINVAL; 1290 status = -EINVAL;
1294 dev_err(&spi->dev, 1291 dev_err(&spi->dev,
1295 "setup - " 1292 "setup - "