diff options
-rw-r--r-- | drivers/spi/spi-rockchip.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index 7e54e1a69cc8..87d1b9837d94 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c | |||
@@ -442,12 +442,8 @@ static void rockchip_spi_dma_txcb(void *data) | |||
442 | static int rockchip_spi_prepare_dma(struct rockchip_spi *rs) | 442 | static int rockchip_spi_prepare_dma(struct rockchip_spi *rs) |
443 | { | 443 | { |
444 | unsigned long flags; | 444 | unsigned long flags; |
445 | struct dma_slave_config rxconf, txconf; | ||
446 | struct dma_async_tx_descriptor *rxdesc, *txdesc; | 445 | struct dma_async_tx_descriptor *rxdesc, *txdesc; |
447 | 446 | ||
448 | memset(&rxconf, 0, sizeof(rxconf)); | ||
449 | memset(&txconf, 0, sizeof(txconf)); | ||
450 | |||
451 | spin_lock_irqsave(&rs->lock, flags); | 447 | spin_lock_irqsave(&rs->lock, flags); |
452 | rs->state &= ~RXBUSY; | 448 | rs->state &= ~RXBUSY; |
453 | rs->state &= ~TXBUSY; | 449 | rs->state &= ~TXBUSY; |
@@ -455,10 +451,13 @@ static int rockchip_spi_prepare_dma(struct rockchip_spi *rs) | |||
455 | 451 | ||
456 | rxdesc = NULL; | 452 | rxdesc = NULL; |
457 | if (rs->rx) { | 453 | if (rs->rx) { |
458 | rxconf.direction = DMA_DEV_TO_MEM; | 454 | struct dma_slave_config rxconf = { |
459 | rxconf.src_addr = rs->dma_rx.addr; | 455 | .direction = DMA_DEV_TO_MEM, |
460 | rxconf.src_addr_width = rs->n_bytes; | 456 | .src_addr = rs->dma_rx.addr, |
461 | rxconf.src_maxburst = 1; | 457 | .src_addr_width = rs->n_bytes, |
458 | .src_maxburst = 1, | ||
459 | }; | ||
460 | |||
462 | dmaengine_slave_config(rs->dma_rx.ch, &rxconf); | 461 | dmaengine_slave_config(rs->dma_rx.ch, &rxconf); |
463 | 462 | ||
464 | rxdesc = dmaengine_prep_slave_sg( | 463 | rxdesc = dmaengine_prep_slave_sg( |
@@ -474,10 +473,13 @@ static int rockchip_spi_prepare_dma(struct rockchip_spi *rs) | |||
474 | 473 | ||
475 | txdesc = NULL; | 474 | txdesc = NULL; |
476 | if (rs->tx) { | 475 | if (rs->tx) { |
477 | txconf.direction = DMA_MEM_TO_DEV; | 476 | struct dma_slave_config txconf = { |
478 | txconf.dst_addr = rs->dma_tx.addr; | 477 | .direction = DMA_MEM_TO_DEV, |
479 | txconf.dst_addr_width = rs->n_bytes; | 478 | .dst_addr = rs->dma_tx.addr, |
480 | txconf.dst_maxburst = rs->fifo_len / 2; | 479 | .dst_addr_width = rs->n_bytes, |
480 | .dst_maxburst = rs->fifo_len / 2, | ||
481 | }; | ||
482 | |||
481 | dmaengine_slave_config(rs->dma_tx.ch, &txconf); | 483 | dmaengine_slave_config(rs->dma_tx.ch, &txconf); |
482 | 484 | ||
483 | txdesc = dmaengine_prep_slave_sg( | 485 | txdesc = dmaengine_prep_slave_sg( |