Commit 35732576 authored by Stefan Agner's avatar Stefan Agner Committed by Mark Brown

spi: spi-atmel: Use correct enum for DMA transfer direction

Use enum dma_transfer_direction as required by the functions
dmaengine_prep_slave_(sg|single)() instead of enum dma_data_direction.
This won't change behavior in practice as the enum values are
equivalent.

This fixes two warnings when building with clang:
  drivers/spi/spi-atmel.c:771:12: warning: implicit conversion from enumeration
      type 'enum dma_data_direction' to different enumeration type
      'enum dma_transfer_direction'
      [-Wenum-conversion]
                                                     DMA_FROM_DEVICE,
                                                     ^~~~~~~~~~~~~~~
  ...
Signed-off-by: default avatarStefan Agner <stefan@agner.ch>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9581329e
...@@ -768,14 +768,14 @@ static int atmel_spi_next_xfer_dma_submit(struct spi_master *master, ...@@ -768,14 +768,14 @@ static int atmel_spi_next_xfer_dma_submit(struct spi_master *master,
rxdesc = dmaengine_prep_slave_single(rxchan, rxdesc = dmaengine_prep_slave_single(rxchan,
as->dma_addr_rx_bbuf, as->dma_addr_rx_bbuf,
xfer->len, xfer->len,
DMA_FROM_DEVICE, DMA_DEV_TO_MEM,
DMA_PREP_INTERRUPT | DMA_PREP_INTERRUPT |
DMA_CTRL_ACK); DMA_CTRL_ACK);
} else { } else {
rxdesc = dmaengine_prep_slave_sg(rxchan, rxdesc = dmaengine_prep_slave_sg(rxchan,
xfer->rx_sg.sgl, xfer->rx_sg.sgl,
xfer->rx_sg.nents, xfer->rx_sg.nents,
DMA_FROM_DEVICE, DMA_DEV_TO_MEM,
DMA_PREP_INTERRUPT | DMA_PREP_INTERRUPT |
DMA_CTRL_ACK); DMA_CTRL_ACK);
} }
...@@ -787,14 +787,14 @@ static int atmel_spi_next_xfer_dma_submit(struct spi_master *master, ...@@ -787,14 +787,14 @@ static int atmel_spi_next_xfer_dma_submit(struct spi_master *master,
memcpy(as->addr_tx_bbuf, xfer->tx_buf, xfer->len); memcpy(as->addr_tx_bbuf, xfer->tx_buf, xfer->len);
txdesc = dmaengine_prep_slave_single(txchan, txdesc = dmaengine_prep_slave_single(txchan,
as->dma_addr_tx_bbuf, as->dma_addr_tx_bbuf,
xfer->len, DMA_TO_DEVICE, xfer->len, DMA_MEM_TO_DEV,
DMA_PREP_INTERRUPT | DMA_PREP_INTERRUPT |
DMA_CTRL_ACK); DMA_CTRL_ACK);
} else { } else {
txdesc = dmaengine_prep_slave_sg(txchan, txdesc = dmaengine_prep_slave_sg(txchan,
xfer->tx_sg.sgl, xfer->tx_sg.sgl,
xfer->tx_sg.nents, xfer->tx_sg.nents,
DMA_TO_DEVICE, DMA_MEM_TO_DEV,
DMA_PREP_INTERRUPT | DMA_PREP_INTERRUPT |
DMA_CTRL_ACK); DMA_CTRL_ACK);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment