aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2007-07-31 03:38:41 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-31 18:39:39 -0400
commit20ba09b979f7e1de790968a9175c6caceda00261 (patch)
tree1fbc7a8892a7385a37f858af592fb84fa134017e /drivers/spi
parent49bb23006b220c11bcf4e1d3eb99c289e6ab855e (diff)
spi_mpc83xx: get rid of magic numbers
Magic-numbers-R-Evil Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Acked-by: Kumar Gala <galak@kernel.crashing.org> 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')
-rw-r--r--drivers/spi/spi_mpc83xx.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index 0b99fd9f5171..e2d8dbc15c80 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -153,7 +153,8 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, int value)
153 len = len - 1; 153 len = len - 1;
154 154
155 /* mask out bits we are going to set */ 155 /* mask out bits we are going to set */
156 regval &= ~0x38ff0000; 156 regval &= ~(SPMODE_CP_BEGIN_EDGECLK | SPMODE_CI_INACTIVEHIGH |
157 SPMODE_LEN(0xF) | SPMODE_DIV16 | SPMODE_PM(0xF));
157 158
158 if (spi->mode & SPI_CPHA) 159 if (spi->mode & SPI_CPHA)
159 regval |= SPMODE_CP_BEGIN_EDGECLK; 160 regval |= SPMODE_CP_BEGIN_EDGECLK;
@@ -248,7 +249,7 @@ int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
248 regval = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode); 249 regval = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode);
249 250
250 /* Mask out bits_per_wordgth */ 251 /* Mask out bits_per_wordgth */
251 regval &= 0xff0fffff; 252 regval &= ~SPMODE_LEN(0xF);
252 regval |= SPMODE_LEN(bits_per_word); 253 regval |= SPMODE_LEN(bits_per_word);
253 254
254 /* Turn off SPI unit prior changing mode */ 255 /* Turn off SPI unit prior changing mode */