aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/spi/spi_mpc83xx.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index 44a2b46ccb79..df6420029004 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -123,6 +123,7 @@ static inline u32 mpc83xx_spi_read_reg(__be32 __iomem * reg)
123} 123}
124 124
125#define MPC83XX_SPI_RX_BUF(type) \ 125#define MPC83XX_SPI_RX_BUF(type) \
126static \
126void mpc83xx_spi_rx_buf_##type(u32 data, struct mpc83xx_spi *mpc83xx_spi) \ 127void mpc83xx_spi_rx_buf_##type(u32 data, struct mpc83xx_spi *mpc83xx_spi) \
127{ \ 128{ \
128 type * rx = mpc83xx_spi->rx; \ 129 type * rx = mpc83xx_spi->rx; \
@@ -131,6 +132,7 @@ void mpc83xx_spi_rx_buf_##type(u32 data, struct mpc83xx_spi *mpc83xx_spi) \
131} 132}
132 133
133#define MPC83XX_SPI_TX_BUF(type) \ 134#define MPC83XX_SPI_TX_BUF(type) \
135static \
134u32 mpc83xx_spi_tx_buf_##type(struct mpc83xx_spi *mpc83xx_spi) \ 136u32 mpc83xx_spi_tx_buf_##type(struct mpc83xx_spi *mpc83xx_spi) \
135{ \ 137{ \
136 u32 data; \ 138 u32 data; \
@@ -172,7 +174,7 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, int value)
172 174
173 if (cs->hw_mode != regval) { 175 if (cs->hw_mode != regval) {
174 unsigned long flags; 176 unsigned long flags;
175 void *tmp_ptr = &mpc83xx_spi->base->mode; 177 __be32 __iomem *mode = &mpc83xx_spi->base->mode;
176 178
177 regval = cs->hw_mode; 179 regval = cs->hw_mode;
178 /* Turn off IRQs locally to minimize time that 180 /* Turn off IRQs locally to minimize time that
@@ -180,8 +182,8 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, int value)
180 */ 182 */
181 local_irq_save(flags); 183 local_irq_save(flags);
182 /* Turn off SPI unit prior changing mode */ 184 /* Turn off SPI unit prior changing mode */
183 mpc83xx_spi_write_reg(tmp_ptr, regval & ~SPMODE_ENABLE); 185 mpc83xx_spi_write_reg(mode, regval & ~SPMODE_ENABLE);
184 mpc83xx_spi_write_reg(tmp_ptr, regval); 186 mpc83xx_spi_write_reg(mode, regval);
185 local_irq_restore(flags); 187 local_irq_restore(flags);
186 } 188 }
187 if (mpc83xx_spi->activate_cs) 189 if (mpc83xx_spi->activate_cs)
@@ -284,7 +286,7 @@ int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
284 regval = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode); 286 regval = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode);
285 if (cs->hw_mode != regval) { 287 if (cs->hw_mode != regval) {
286 unsigned long flags; 288 unsigned long flags;
287 void *tmp_ptr = &mpc83xx_spi->base->mode; 289 __be32 __iomem *mode = &mpc83xx_spi->base->mode;
288 290
289 regval = cs->hw_mode; 291 regval = cs->hw_mode;
290 /* Turn off IRQs locally to minimize time 292 /* Turn off IRQs locally to minimize time
@@ -292,8 +294,8 @@ int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
292 */ 294 */
293 local_irq_save(flags); 295 local_irq_save(flags);
294 /* Turn off SPI unit prior changing mode */ 296 /* Turn off SPI unit prior changing mode */
295 mpc83xx_spi_write_reg(tmp_ptr, regval & ~SPMODE_ENABLE); 297 mpc83xx_spi_write_reg(mode, regval & ~SPMODE_ENABLE);
296 mpc83xx_spi_write_reg(tmp_ptr, regval); 298 mpc83xx_spi_write_reg(mode, regval);
297 local_irq_restore(flags); 299 local_irq_restore(flags);
298 } 300 }
299 return 0; 301 return 0;
@@ -483,7 +485,7 @@ static int mpc83xx_spi_setup(struct spi_device *spi)
483 return 0; 485 return 0;
484} 486}
485 487
486irqreturn_t mpc83xx_spi_irq(s32 irq, void *context_data) 488static irqreturn_t mpc83xx_spi_irq(s32 irq, void *context_data)
487{ 489{
488 struct mpc83xx_spi *mpc83xx_spi = context_data; 490 struct mpc83xx_spi *mpc83xx_spi = context_data;
489 u32 event; 491 u32 event;