aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/spi/spi-ep93xx.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
index d7eccfc40ac9..d5e64201cdd3 100644
--- a/drivers/spi/spi-ep93xx.c
+++ b/drivers/spi/spi-ep93xx.c
@@ -429,17 +429,9 @@ static void ep93xx_spi_chip_setup(const struct ep93xx_spi *espi,
429 ep93xx_spi_write_u16(espi, SSPCR0, cr0); 429 ep93xx_spi_write_u16(espi, SSPCR0, cr0);
430} 430}
431 431
432static inline int bits_per_word(const struct ep93xx_spi *espi)
433{
434 struct spi_message *msg = espi->current_msg;
435 struct spi_transfer *t = msg->state;
436
437 return t->bits_per_word;
438}
439
440static void ep93xx_do_write(struct ep93xx_spi *espi, struct spi_transfer *t) 432static void ep93xx_do_write(struct ep93xx_spi *espi, struct spi_transfer *t)
441{ 433{
442 if (bits_per_word(espi) > 8) { 434 if (t->bits_per_word > 8) {
443 u16 tx_val = 0; 435 u16 tx_val = 0;
444 436
445 if (t->tx_buf) 437 if (t->tx_buf)
@@ -458,7 +450,7 @@ static void ep93xx_do_write(struct ep93xx_spi *espi, struct spi_transfer *t)
458 450
459static void ep93xx_do_read(struct ep93xx_spi *espi, struct spi_transfer *t) 451static void ep93xx_do_read(struct ep93xx_spi *espi, struct spi_transfer *t)
460{ 452{
461 if (bits_per_word(espi) > 8) { 453 if (t->bits_per_word > 8) {
462 u16 rx_val; 454 u16 rx_val;
463 455
464 rx_val = ep93xx_spi_read_u16(espi, SSPDR); 456 rx_val = ep93xx_spi_read_u16(espi, SSPDR);
@@ -544,7 +536,7 @@ ep93xx_spi_dma_prepare(struct ep93xx_spi *espi, enum dma_transfer_direction dir)
544 size_t len = t->len; 536 size_t len = t->len;
545 int i, ret, nents; 537 int i, ret, nents;
546 538
547 if (bits_per_word(espi) > 8) 539 if (t->bits_per_word > 8)
548 buswidth = DMA_SLAVE_BUSWIDTH_2_BYTES; 540 buswidth = DMA_SLAVE_BUSWIDTH_2_BYTES;
549 else 541 else
550 buswidth = DMA_SLAVE_BUSWIDTH_1_BYTE; 542 buswidth = DMA_SLAVE_BUSWIDTH_1_BYTE;