From 20ba09b979f7e1de790968a9175c6caceda00261 Mon Sep 17 00:00:00 2001 From: Anton Vorontsov Date: Tue, 31 Jul 2007 00:38:41 -0700 Subject: spi_mpc83xx: get rid of magic numbers Magic-numbers-R-Evil Signed-off-by: Anton Vorontsov Acked-by: Kumar Gala Signed-off-by: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/spi/spi_mpc83xx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c index 0b99fd9f517..e2d8dbc15c8 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) len = len - 1; /* mask out bits we are going to set */ - regval &= ~0x38ff0000; + regval &= ~(SPMODE_CP_BEGIN_EDGECLK | SPMODE_CI_INACTIVEHIGH | + SPMODE_LEN(0xF) | SPMODE_DIV16 | SPMODE_PM(0xF)); if (spi->mode & SPI_CPHA) regval |= SPMODE_CP_BEGIN_EDGECLK; @@ -248,7 +249,7 @@ int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t) regval = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode); /* Mask out bits_per_wordgth */ - regval &= 0xff0fffff; + regval &= ~SPMODE_LEN(0xF); regval |= SPMODE_LEN(bits_per_word); /* Turn off SPI unit prior changing mode */ -- cgit