diff options
author | Stefan Agner <stefan@agner.ch> | 2018-03-19 18:16:22 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-03-19 21:02:12 -0400 |
commit | 768d59f5d0139a6ff09e4430ec29cdc8b436421a (patch) | |
tree | 2ffa54a8b63bda86dbe69e3c815135e7060bdcef | |
parent | 7928b2cbe55b2a410a0f5c1f154610059c57b1b2 (diff) |
spi: rspi: use correct enum for DMA transfer direction
Use enum dma_transfer_direction as required by dmaengine_prep_slave_sg
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-rspi.c:538:26: warning: implicit conversion from enumeration
type 'enum dma_data_direction' to different enumeration type
'enum dma_transfer_direction' [-Wenum-conversion]
rx->sgl, rx->nents, DMA_FROM_DEVICE,
^~~~~~~~~~~~~~~
drivers/spi/spi-rspi.c:558:26: warning: implicit conversion from enumeration
type 'enum dma_data_direction' to different enumeration type
'enum dma_transfer_direction' [-Wenum-conversion]
tx->sgl, tx->nents, DMA_TO_DEVICE,
^~~~~~~~~~~~~
Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/spi/spi-rspi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index 0835a8d88fb8..95dc4d78618d 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c | |||
@@ -535,7 +535,7 @@ static int rspi_dma_transfer(struct rspi_data *rspi, struct sg_table *tx, | |||
535 | /* First prepare and submit the DMA request(s), as this may fail */ | 535 | /* First prepare and submit the DMA request(s), as this may fail */ |
536 | if (rx) { | 536 | if (rx) { |
537 | desc_rx = dmaengine_prep_slave_sg(rspi->master->dma_rx, | 537 | desc_rx = dmaengine_prep_slave_sg(rspi->master->dma_rx, |
538 | rx->sgl, rx->nents, DMA_FROM_DEVICE, | 538 | rx->sgl, rx->nents, DMA_DEV_TO_MEM, |
539 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | 539 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
540 | if (!desc_rx) { | 540 | if (!desc_rx) { |
541 | ret = -EAGAIN; | 541 | ret = -EAGAIN; |
@@ -555,7 +555,7 @@ static int rspi_dma_transfer(struct rspi_data *rspi, struct sg_table *tx, | |||
555 | 555 | ||
556 | if (tx) { | 556 | if (tx) { |
557 | desc_tx = dmaengine_prep_slave_sg(rspi->master->dma_tx, | 557 | desc_tx = dmaengine_prep_slave_sg(rspi->master->dma_tx, |
558 | tx->sgl, tx->nents, DMA_TO_DEVICE, | 558 | tx->sgl, tx->nents, DMA_MEM_TO_DEV, |
559 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | 559 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
560 | if (!desc_tx) { | 560 | if (!desc_tx) { |
561 | ret = -EAGAIN; | 561 | ret = -EAGAIN; |