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_mpc83xx.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_mpc83xx.c')
-rw-r--r-- | drivers/spi/spi_mpc83xx.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c index a32ccb44065e..0926a3e293e0 100644 --- a/drivers/spi/spi_mpc83xx.c +++ b/drivers/spi/spi_mpc83xx.c | |||
@@ -447,9 +447,6 @@ static int mpc83xx_spi_setup(struct spi_device *spi) | |||
447 | } | 447 | } |
448 | mpc83xx_spi = spi_master_get_devdata(spi->master); | 448 | mpc83xx_spi = spi_master_get_devdata(spi->master); |
449 | 449 | ||
450 | if (!spi->bits_per_word) | ||
451 | spi->bits_per_word = 8; | ||
452 | |||
453 | hw_mode = cs->hw_mode; /* Save orginal settings */ | 450 | hw_mode = cs->hw_mode; /* Save orginal settings */ |
454 | cs->hw_mode = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode); | 451 | cs->hw_mode = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode); |
455 | /* mask out bits we are going to set */ | 452 | /* mask out bits we are going to set */ |
@@ -471,9 +468,6 @@ static int mpc83xx_spi_setup(struct spi_device *spi) | |||
471 | return retval; | 468 | return retval; |
472 | } | 469 | } |
473 | 470 | ||
474 | dev_dbg(&spi->dev, "%s, mode %d, %u bits/w, %u Hz\n", | ||
475 | __func__, spi->mode & (SPI_CPOL | SPI_CPHA), | ||
476 | spi->bits_per_word, spi->max_speed_hz); | ||
477 | #if 0 /* Don't think this is needed */ | 471 | #if 0 /* Don't think this is needed */ |
478 | /* NOTE we _need_ to call chipselect() early, ideally with adapter | 472 | /* NOTE we _need_ to call chipselect() early, ideally with adapter |
479 | * setup, unless the hardware defaults cooperate to avoid confusion | 473 | * setup, unless the hardware defaults cooperate to avoid confusion |